mobilerun-ios to connect your own iPhone to Mobilerun and run tasks from the Playground or API. Once connected, it appears as a Personal Phone on the Devices page.
This walkthrough covers mobilerun-ios v0.4.0. For unattended hosts, configuration, and command details, see the Mobilerun iOS reference.
The video shows an earlier setup flow. Follow the written steps below for
setup, verify, and signing all bundled WDA extensions.Requirements
- A Mobilerun account with a Personal Phone subscription.
- A Mac and an iPhone connected with a data-capable USB cable.
- Internet access on the host and phone for downloads, activation, and developer-profile validation.
- For WDA signing: either a paid developer team’s App Store Connect API key, or Xcode with an Apple Account, a development identity, and matching provisioning profiles.
- For the manual build path: Xcode with support for your iPhone’s iOS version.
setup --wda.
1. Install the CLI
brew update and brew upgrade droidrun/tap/mobilerun-ios. If using the installer, rerun it to update.
2. Connect and trust the iPhone
Unlock the phone, connect it over USB, and accept Trust This Computer. Then list devices:<udid> with that identifier. Keep the phone unlocked while completing setup.
3. Prepare the device
Developer Mode and trust
When prompted, enable Settings → Privacy & Security → Developer Mode, allow the restart, unlock the phone, and confirm Turn On. If Developer Mode is not visible, connect the phone to Xcode and check again. For WDA, give the phone internet access and trust the developer profile under Settings → General → VPN & Device Management when prompted. Setup checks that the runner can launch, not just that the app was installed.Choose a WDA signing path
- Xcode
- App Store Connect
Local Xcode signing: use a keychain identity with provisioning profiles for the runner and all extensions. If those profiles do not exist yet, complete the manual build below, then rerun setup. Personal-team signing has expiry and capability restrictions; do not assume a paid team and a personal team can provision the same extensions/capabilities.Enable the Network Extensions / Packet Tunnel capability for the runner and tunnel App IDs in your team’s provisioning configuration. Both the installed host app and tunnel extension must carry Alternatively, after configuring the team and unique bundle base, build the tunnel scheme from the terminal:This command builds for testing; use Cmd+U with the same scheme/settings to install and run on the phone. A successful build without the entitlements does not prove VPN support: iOS can reject the VPN configuration even when the extension is embedded. First use may also require manual VPN/passcode consent.
Manual Xcode signing and build
Use this path to build WDA yourself or bootstrap the local Xcode profiles. The example pins Mobilerun WDA v1.3.0, whose project includes Broadcast and the opt-in Tunnel extension:- Select your connected iPhone as the run destination. Use WebDriverAgentRunner for ordinary automation and broadcasting, or WebDriverAgentRunnerTunnel for on-device SOCKS5/VPN support. The default scheme deliberately excludes the tunnel extension. For the tunnel scheme, complete the extra build and entitlement steps below first.
-
Configure the runner and every extension your scheme includes—all three targets for a tunnel-enabled build:
- For each included target, open Signing & Capabilities, enable Automatically manage signing, and select the same development team. Ensure the included extensions have valid profiles for the selected phone; they are built and embedded with the runner, not installed as unrelated apps.
-
If the default bundle identifier is already registered, use a unique base identifier. In
Configurations/IOSSettings.xcconfig, updateWDA_PRODUCT_BUNDLE_IDENTIFIER, for example tocom.example.WebDriverAgentRunner. The runner and extension settings reference this value. Verify the resolved identifiers remain aligned:When passing--bundle-idto the CLI, use the installed runner app identifier, including.xctrunner, not the Xcode test target base. - Press Cmd+U (Product → Test) to build, install, and run the test runner on the phone. This is a test action, not just Build for Testing. The default scheme embeds Broadcast; the tunnel scheme embeds Broadcast and Tunnel.
- If launch fails because the developer profile is not trusted, open Settings → General → VPN & Device Management on the phone, trust the developer, and run Cmd+U again. The phone needs internet access for profile validation.
-
Stop the Xcode test session before letting the CLI own the device. Run setup again:
Extra steps for a tunnel-enabled WDA build
TheWebDriverAgentRunnerTunnel scheme requires a paid Apple developer team. A free/personal team cannot provision the Network Extension capability. The default scheme remains suitable when you do not need the on-device SOCKS5 tunnel.Before building the tunnel scheme, initialize and build its engine from the WDA checkout:com.apple.developer.networking.networkextension with packet-tunnel-provider.In Xcode’s build settings, set these user-defined values for the tunnel build:4. Configure long-lived operation
Disable Auto-Lock
Set Settings → Display & Brightness → Auto-Lock → Never. A locked or sleeping phone can interrupt automation and streaming. The separateauto workflow attempts and verifies this setting; do not assume an ordinary setup/portal invocation does it for you.
Enable automatic date and time
Set Settings → General → Date & Time → Set Automatically to on. This avoids a manually fixed time zone interfering with location-based behavior; actual automatic time-zone updates also depend on the phone’s settings and connectivity.Decide how to handle unlocking
Keep a passcode on a supervised-use phone and unlock it when required. For a dedicated unattended device, decide whether your security policy permits removing the passcode: a lock screen after a reboot or runner recovery can otherwise require someone to unlock it.5. Verify readiness
Before starting a portal, run:--deep is an active WDA launch probe, not a native check or a cloud connectivity test. If the installed runner’s signing has expired, explicitly re-sign and reinstall with your signing backend:
6. Log in to Mobilerun
~/.mobilerun-ios/config.yaml with owner-only permissions. For headless use, export an API key instead:
mobilerun-ios logout clears the saved token; it does not clear an exported environment token.
7. Start the connection
mobilerun-ios stop <udid>, or stop all detached portals with mobilerun-ios stop.
To watch continuously for USB phones and prepare them as they arrive, stop the existing portal and use Automatic onboarding:
8. Confirm end-to-end operation
Open Devices, confirm your iPhone is online, open its stream, and run a task from the Playground. A successfulverify command alone does not validate cloud authentication, media transport, or task execution.
Troubleshooting
No devices appear in list
No devices appear in list
Use a data-capable USB cable, unlock the iPhone, and accept Trust This Computer. Reconnect and run
mobilerun-ios list again.Setup or verify reports that the device is already owned
Setup or verify reports that the device is already owned
Stop the Xcode test, detached portal (
mobilerun-ios stop <udid>), or foreground/auto process before retrying. Wait for it to finish shutting down before retrying.Runner is installed but will not launch
Runner is installed but will not launch
Check Developer Mode, internet access, and developer trust on the phone. Run
verify --deep. If signing has expired, stop the portal and use setup --reinstall with the correct signing flags, or rebuild the runner and all included extensions in Xcode.Signing fails for an extension
Signing fails for an extension
WebDriverAgentBroadcast and, for the tunnel scheme, WebDriverAgentTunnel need the same team as the runner and profiles for their correctly prefixed bundle IDs. Check capabilities and profile validity, not just the runner’s signing status.Cloud authentication fails
Cloud authentication fails
Run
mobilerun-ios whoami, then log in again if needed. If an environment token is set, it overrides the saved login: replace or unset MOBILERUN_IOS_TOKEN as appropriate.Screen goes black or a recovered session stays locked
Screen goes black or a recovered session stays locked
Check Auto-Lock and unlock the device. For unattended use, review the device’s passcode/security policy rather than assuming automatic process recovery can bypass the lock screen.
Known issues
- TikTok crashes automation. Dumping TikTok’s accessibility tree times out, which crashes the Mobilerun automation session. Avoid tasks that drive the TikTok app for now.