Skip to content

pymobiledevice3 webinspector

Control Safari/WebViews (tabs, automation, JS shells, CDP). Requires Web Inspector and Remote Automation enabled on the device.

opened-tabs

Show all currently opened tabs.

 Opt-in: iOS >= 18: Settings -> Apps -> Safari -> Advanced -> Web Inspector

iOS < 18: Settings -> Safari -> Advanced -> Web Inspector

pymobiledevice3 webinspector opened-tabs [OPTIONS]

Options:

Option Description
--native macOS only: reach the iOS 17+ tunnel by piggybacking Apple's own remoted tunnel via the remotepairingd service. NO root, no entitlement, no Xcode, and remoted is left running (so it coexists with Xcode/devicectl). Rides Apple's kernel-routable tunnel, so throughput matches the kernel tunnel. Mutually exclusive with --rsd/--tunnel/--userspace. [env var: PYMOBILEDEVICE3_NATIVE]
-t, --timeout <float> Seconds to wait for WebInspector to respond. [default: 3.0]

Accepts the connection options: --rsd, --tunnel, --userspace, --mobdev2, --usbmux, --udid.

launch

Launch a specific URL in Safari.

 Opt-in (iOS >= 18): Settings -> Apps -> Safari -> Advanced -> Web Inspector Settings -> Apps -> Safari -> Advanced -> Remote Automation

Opt-in (iOS < 18): Settings -> Safari -> Advanced -> Web Inspector Settings -> Safari -> Advanced -> Remote Automation

pymobiledevice3 webinspector launch [OPTIONS] {url}

Arguments:

Argument Description
url [required]

Options:

Option Description
--native macOS only: reach the iOS 17+ tunnel by piggybacking Apple's own remoted tunnel via the remotepairingd service. NO root, no entitlement, no Xcode, and remoted is left running (so it coexists with Xcode/devicectl). Rides Apple's kernel-routable tunnel, so throughput matches the kernel tunnel. Mutually exclusive with --rsd/--tunnel/--userspace. [env var: PYMOBILEDEVICE3_NATIVE]
-t, --timeout <float> Seconds to wait for WebInspector to respond. [default: 3.0]

Accepts the connection options: --rsd, --tunnel, --userspace, --mobdev2, --usbmux, --udid.

shell

Create an IPython shell for interacting with a WebView.

 Opt-in (iOS >= 18): Settings -> Apps -> Safari -> Advanced -> Web Inspector Settings -> Apps -> Safari -> Advanced -> Remote Automation

Opt-in (iOS < 18): Settings -> Safari -> Advanced -> Web Inspector Settings -> Safari -> Advanced -> Remote Automation

pymobiledevice3 webinspector shell [OPTIONS]

Options:

Option Description
--native macOS only: reach the iOS 17+ tunnel by piggybacking Apple's own remoted tunnel via the remotepairingd service. NO root, no entitlement, no Xcode, and remoted is left running (so it coexists with Xcode/devicectl). Rides Apple's kernel-routable tunnel, so throughput matches the kernel tunnel. Mutually exclusive with --rsd/--tunnel/--userspace. [env var: PYMOBILEDEVICE3_NATIVE]
-t, --timeout <float> Seconds to wait for WebInspector to respond. [default: 3.0]

Accepts the connection options: --rsd, --tunnel, --userspace, --mobdev2, --usbmux, --udid.

js-shell

Create a javascript shell. This interpreter runs on your local machine, but evaluates each expression on the remote

 Opt-in: iOS >= 18: Settings -> Apps -> Safari -> Advanced -> Web Inspector iOS < 18: Settings -> Safari -> Advanced -> Web Inspector  for automation also enable: iOS >= 18: Settings -> Apps -> Safari -> Advanced -> Remote Automation iOS < 18: Settings -> Safari -> Advanced -> Remote Automation

pymobiledevice3 webinspector js-shell [OPTIONS]

Options:

Option Description
--native macOS only: reach the iOS 17+ tunnel by piggybacking Apple's own remoted tunnel via the remotepairingd service. NO root, no entitlement, no Xcode, and remoted is left running (so it coexists with Xcode/devicectl). Rides Apple's kernel-routable tunnel, so throughput matches the kernel tunnel. Mutually exclusive with --rsd/--tunnel/--userspace. [env var: PYMOBILEDEVICE3_NATIVE]
--url <str>
-t, --timeout <float> Seconds to wait for WebInspector to respond. [default: 10.0]
--automation / --no-automation Use remote automation (requires Remote Automation toggle). [default: no-automation]
--bundle-id <str> Target app bundle identifier. Inspector: filter open pages (omit for all). Automation: launch app (omit for Safari).
--console-enable / --no-console-enable Enable console events for Inspector mode. Cannot be combined with --automation.
--open-safari / --no-open-safari Open Safari before selecting a page. [default: no-open-safari]
--no-replayed-log Don't print the console history the page replays on attach (webinspector.console.replay).

Accepts the connection options: --rsd, --tunnel, --userspace, --mobdev2, --usbmux, --udid.

cdp

Start a CDP server for debugging WebViews and inspectable JSContexts.

 A client that auto-attaches with waitForDebuggerOnStart (VS Code, Playwright, Puppeteer) is attached to every JSContext an application creates before the context runs, and holds it until the client releases it - the equivalent of Safari's "Automatically Show Web Inspector for JSContexts". WKWebView pages cannot be held before they run; they are attached the moment they appear, and their cross-site navigations are held until the client's breakpoints reached the new process.

 --pause-new-targets (or the switch on the landing page) is Safari's "Automatically Pause Connecting to JSContexts": every new JSContext is stopped on its first statement and listed as paused; opening it lands DevTools on that pause.

 Open the following URL in Google Chrome and pick a page to inspect: http://127.0.0.1:9222/

 Chrome-compatible debugger clients can attach through the browser-level endpoint advertised by /json/version. For VS Code, use a launch.json configuration such as: {"type": "chrome", "request": "attach", "address": "127.0.0.1", "port": 9222, "urlFilter": "*", "webRoot": "${workspaceFolder}"}

 Prefer this over chrome://inspect: chrome://inspect routes the DevTools frontend through Chrome's browser-process relay (network target), which deadlocks under sustained console traffic and freezes the console/screen. The URL above serves the DevTools frontend so it connects to this bridge directly, bypassing that relay.

 The frontend is fetched from the hosted build; when that is unreachable (offline), it is served from a local Chrome instead. Pass --chrome if Chrome is not on PATH or in a default install location.

pymobiledevice3 webinspector cdp [OPTIONS]

Options:

Option Description
--native macOS only: reach the iOS 17+ tunnel by piggybacking Apple's own remoted tunnel via the remotepairingd service. NO root, no entitlement, no Xcode, and remoted is left running (so it coexists with Xcode/devicectl). Rides Apple's kernel-routable tunnel, so throughput matches the kernel tunnel. Mutually exclusive with --rsd/--tunnel/--userspace. [env var: PYMOBILEDEVICE3_NATIVE]
--host <str> [default: 127.0.0.1]
--port <int> [default: 9222]
--chrome <str>
--pause-new-targets Attach to every JSContext an app creates before it runs and stop it on its first statement (Safari's "Automatically Pause Connecting to JSContexts"); open it from the landing page to land on the pause. Sets the initial state of the landing page's "Pause new JSContexts on launch" switch.
--trace <path> Record every protocol message, in both directions, to this JSON-lines file - attach it to a bug report.

Accepts the connection options: --rsd, --tunnel, --userspace, --mobdev2, --usbmux, --udid.