iPhone-use
Browse docs
On this page

Prepare your iPhone

Start with standard mode. Development signing is only required for Runner.

Standard vs runner: which needs signing?

Choose standard for screenshot-based operation without Runner setup, or runner for XCTest and available element references. Both require full Xcode, USB trust, Developer Mode and an unlocked phone.

Requirementstandardrunner
ObserveScreenshotsScreenshots and available accessibility elements
ActNative HIDXCTest Runner
Runner installation / development signingNot requiredRequired

Standard currently targets macOS/iOS 27 with full Xcode 27 on Apple Silicon. Check the tested scope. An active session does not switch modes automatically.

For signing and environment requirements across tools, see the iPhone-use, Appium and iPhone Mirroring comparison.

Before you start

  • Install full Xcode and open it once to finish installation. Select it in Xcode Settings → Locations. xcode-select -p should end in the app’s Contents/Developer; Command Line Tools alone are insufficient.
  • Connect the iPhone over USB, trust the Mac, enable Developer Mode and keep the phone unlocked.
  • Only for Runner mode: have an Apple Development certificate and its private key in Keychain, plus an iOS development profile authorizing that certificate, device and Runner bundle ID.

First-time trust, Developer Mode, Apple sign-in and permission dialogs require your action on the devices. Fresh-Mac and free Personal Team setup and renewal are not yet validated.

Connect in standard mode

iphone-use devices
export IOS_UDID='YOUR_DEVICE_ID'
iphone-use connect --device "$IOS_UDID" --mode standard

Use the actual device ID. Check result.controlAvailable=true, keep the returned session ID, observe, then disconnect when done. Standard mode never starts Runner or silently falls back to XCTest. New users default to standard; specify the mode explicitly when an old preference may exist.

iphone-use --session "SESSION_FROM_CONNECT" observe
iphone-use --session "SESSION_FROM_CONNECT" disconnect

Optional Runner setup

Setup uses existing credentials; it does not log in to Apple or create certificates or profiles. If Xcode has no suitable cached profile, prepare one through your development team’s Apple development profile workflow.

iphone-use setup --device "$IOS_UDID" \
  --profile '/absolute/path/to/development.mobileprovision' \
  --team 'YOUR_TEAM_ID'

The default Runner bundle ID is com.iphone-use.runner.xctrunner. If your profile authorizes another ID, also pass --bundle-id 'com.example.iphone-use.xctrunner'. --identity takes a matching development certificate’s SHA-1 identifier, not private key contents.

Setup progress and preview

Interactive terminal setup shows progress and a local preview by default. Scripted or piped setup emits final JSON only; request progress and preview explicitly when needed:

iphone-use setup --device "$IOS_UDID" --progress --preview

This reuses suitable saved signing material; supply the signing options above when required. Progress output is NDJSON followed by a final JSON result. Read the original command to completion. Setup returns a preview URL but never opens a browser; open it in one existing tab. --preview requires progress and --port requires preview. Setup does not change the preferred connection mode.

iphone-use connect --device "$IOS_UDID" --mode runner

Saved preparation

Preparation is stored in ~/Library/Application Support/iphone-use; the private key stays in Keychain. Later connections reuse successful preparation. Expired profiles, changed Runner files or package upgrades may require setup again. Upgrading from a pre-0.4.0 Runner requires setup with the new complete package before reconnecting; do not mix old Runner files with the new CLI.

Do not use build-runner to work around a release-package setup error. Source development is a different workflow. Follow the actual diagnostic.