Testing on a real iPhone with AI agents: setup, signing, devicectl and device MCP servers
Pair the iPhone once by hand (Trust, Developer Mode, Xcode sign-in). Then the agent can build with xcodebuild -destination 'generic/platform=iOS' -allowProvisioningUpdates, and install, launch and pull crash logs with xcrun devicectl. To tap, type and take screenshots on the phone, add an MCP server that runs WebDriverAgent or its own XCUITest runner.
Last updated:
This page is about the physical device: setup, signing, the command line, tools that support real iPhones, and logs. To write and fix the tests themselves, see iOS UI testing with AI agents. To choose a framework, see Maestro vs XCUITest. For simulator-only drivers, see iOS simulator MCP servers.
When the simulator is not enough
Apple says simulators "don't replicate the performance or features of a physical device", and some hardware-specific features may not be available there. To test such a feature, Apple says to run the code on a physical device. Typical cases:
Hardware features: camera, sensors, on-device inference and real push. mgcrea's mcp-ios-device README names these as the reason it exists.
Performance: launch time, memory, jetsam (out-of-memory kills), thermal behavior. Watchdog, jetsam and thermal events are also report types that Apple says you get from the device, not from the Crashes organizer.
Built-in simulator panes stop at the simulator: Anthropic's docs for the Claude Code Desktop iOS Simulator pane (public beta) say Claude "drives simulated devices only and can't control a physical iPhone or iPad".
Device-specific gaps: Xcode 27.1 release notes say StandBy and most app extensions are unavailable in the iPhone Duo Simulator runtime. See iPhone Duo AI skills.
Signing and entitlements: Apple lists invalid code-signature crashes among the reports you collect from the device itself.
One-time setup the agent cannot do
These steps need a person holding the phone. Tell your agent to stop and ask instead of retrying.
Pair. Connect a cable and tap Trust on the iPhone. Or use Device Hub → + → Pair Nearby Device… (wireless pairing needs iOS 27 or later). From Terminal,
devicectl manage pairpairs a cabled device. Apple: a wirelessly paired device has to be paired again after an OS upgrade, and the device must be unlocked fordevicectlcommands.Developer Mode. Settings → Privacy & Security → Developer Mode, restart, then confirm with the passcode. Apple: the switch only appears after you start pairing or have paired before. There is no command-line switch for it, as the run-device skill also notes.
Signing. Sign in under Xcode → Settings → Apple Accounts. With "Automatically manage signing", Xcode registers the device and creates the development provisioning profile. A personal (free) Apple Account works.
For UI-driving tools only: the mcp-ios-device README says to turn on Settings → Developer → Enable UI Automation, "the one people miss". After the first WebDriverAgent install, you may also have to trust your developer team under Settings → General → VPN & Device Management.
Build, install, launch and test from the command line
Apple's devicectl manages paired devices without opening Xcode. Apple asks scripts to use --json-output and not to parse the human-readable output.
bash
xcrun devicectl list devices # pick the device
xcodebuild build -scheme MyApp \
-destination 'generic/platform=iOS' -allowProvisioningUpdates
xcrun devicectl device install app --device <id> path/to/MyApp.app
xcrun devicectl device process launch --device <id> com.example.MyApp
xcodebuild test -scheme MyApp -destination 'platform=iOS,id=<UDID>' # XCTest/XCUITest on the deviceThe identifier trap. xcodebuild -destination 'platform=iOS,id=…' expects the device's hardware UDID. Older devicectl list devices output showed the CoreDevice identifier instead. The run-device skill documents the resulting "Unable to find a device matching the provided destination specifier" error and builds for generic/platform=iOS instead. Xcode 27 changed this: devicectl list devices now shows the UDID when one is available, and the Info inspector hides the CoreDevice ID by default. Apple's docs say --device accepts the UUID, ECID, UDID or name. On older Xcode versions, build with generic/platform=iOS, and get the UDID from Device Hub (Info → UDID) or from Finder.
Signing pitfalls for agents
Missing profiles. "No profiles for '…' were found" means the build needs
-allowProvisioningUpdatesand an Apple ID signed in to Xcode. "Signing requires a development team" meansDEVELOPMENT_TEAMis missing. Both are documented in the run-device skill.Free team, 7 days. The run-device skill and several WebDriverAgent tools warn that apps signed with a free personal team stop launching after 7 days. Agents then see launch failures that look like code bugs. Rebuild, or use a paid team for daily device runs.
WebDriverAgent needs its own signature. WebDriverAgent-based tools build and sign Appium's runner with your team ID:
appium_prepare_ios_real_devicein Appium MCP,ios-device-wda setupin mcp-ios-device, andIOS_DEVICE_MCP_TEAM_IDin ios-device-mcp.Prompts that hang the agent. Trust dialogs and the Developer Mode confirmation appear on the phone, not in the terminal. Do the first build by hand in Xcode, then let the agent repeat it.
Two different "launch" errors. The run-device skill reports that
CoreDeviceError 10004after--terminate-existingis usually a false alarm. Check withdevicectl device info processesbefore the agent rebuilds.
Tools that support a real iPhone
Only tools whose README states physical iOS support.
| Tool | How it reaches the device | Install (from README) | License | ★ (24 Oct) | Last push |
|---|---|---|---|---|---|
| Mobile MCP (mobile-next) | iOS real device over USB, "connected and trusted"; Android too | claude mcp add mobile-mcp -- npx -y @mobilenext/mobile-mcp@latest | Apache-2.0 | 9,936 | 18 Oct 2026 |
| MobileBuildMCP (getsentry) | Device build/run/test tools; needs code signing set up in Xcode | npx -y mobilebuildmcp@latest mcp | MIT | 6,504 | 22 Oct 2026 |
| agent-device (callstack) | XCTest for physical iOS interactions; also Android | npm install -g agent-device@latest | MIT | 5,125 | 24 Oct 2026 |
| iCTRL (OpenMinis) | Long-running XCUITest runner on the phone, JSON-RPC | Signed .ipa from releases | Apache-2.0 | 554 | 19 Oct 2026 |
| run-device skill (rshankras) | xcodebuild + devicectl, no UI driving | npx skills add https://github.com/rshankras/claude-code-apple-skills --skill run-device | MIT | 826 | 24 Jul 2026 ⚠ |
| simutil (dungngminh) | devicectl; view, screenshots and recording only | brew tap dungngminh/simutil + brew install --cask simutil-desktop | MIT | 1,198 | 22 Oct 2026 |
| Appium MCP (appium) | Appium XCUITest driver + WebDriverAgent, signed by appium_prepare_ios_real_device | claude mcp add appium-mcp -- npx -y appium-mcp@latest | Apache-2.0 | 505 | 23 Oct 2026 |
| mcp-ios-device (mgcrea) | devicectl + WebDriverAgent; logs and crash reports; read-only unless IOS_DEVICE_ALLOW_WRITES | npx -y @mgcrea/mcp-ios-device | MIT | 0 | 9 Oct 2026 |
| ios-device-mcp (ChrisThoma) | devicectl + long-running XCUITest runner over USB | git clone + npm install && npm run build + claude mcp add … | MIT | 1 | 21 Oct 2026 |
| ios-agent (emazaheri) | WebDriverAgent; real iPhone over cable or Wi-Fi | MCP command uvx ios-mcp; check with uvx ios-mcp doctor | MIT | 3 | 9 Oct 2026 |
| podium-mcp (hoainho) | devicectl lifecycle + opt-in WebDriverAgent (PODIUM_WDA_URL) | /plugin marketplace add github:hoainho/podium-mcp | MIT | 6 | 30 Jun 2026 ⚠ |
| lazy_mobile_mcp (leaf76) | devicectl launch/stop; WebDriverAgent for screenshots and taps | npx -y lazy_mobile_mcp@latest setup-codex | MIT | 1 | 19 Jul 2026 ⚠ |
| baremobile (hamr0) | WebDriverAgent over USB | npm install baremobile | Apache-2.0 | 13 | 20 Sep 2026 ⚠ |
| iPhone Mirror MCP (nickatnight96) | macOS iPhone Mirroring (macOS 15+, iOS 18+) | git clone + ./install.sh (README) | MIT | 8 | 23 Oct 2026 |
| simvyn (pranshuchittora) | Dashboard/CLI; USB-connected physical devices | npm install -g simvyn | MIT | 439 | 20 Oct 2026 |
| simwalk (Agulhas-Labs) | simwalk walk … --device <udid> --team <team id>; parallel walks are simulator-only | brew install agulhas-labs/tap/simwalk | Apache-2.0 | 0 | 21 Oct 2026 |
| mobctl (phamphamh) | CLI over Appium + WebDriverAgent, USB; example agent skill file | git clone + ./scripts/up.sh + ./bin/mobctl session (README) | MIT | 1 | 3 Jul 2026 ⚠ |
⚠ = no push for more than 4 weeks. Not for physical iPhones: the Maestro README says "Physical iOS devices are not yet supported" (see Maestro vs XCUITest).
WebDriverAgent, XCUITest runner or Mirroring?
WebDriverAgent (WDA) is Appium's XCUITest-based server on the phone. It is used by Appium MCP, mcp-ios-device, ios-agent, podium-mcp, lazy_mobile_mcp, mobctl and baremobile. It is the most common approach, but you have to sign WDA yourself, and with a free team you re-sign every 7 days.
Own XCTest/XCUITest runner: iCTRL and ios-device-mcp ship their own long-running runner instead of WDA; agent-device uses XCTest for physical iOS. The setup is the same: your team signs it and it stays running on the device.
iPhone Mirroring: iPhone Mirror MCP drives the macOS iPhone Mirroring window. No runner on the phone, but it needs macOS 15+ and iOS 18+, and per its README the session locks as soon as someone picks up the phone.
devicectl only: the run-device skill and simutil install, launch and observe, but do not tap. For an agent that only has to ship a build to the phone and read logs, this is the smallest setup.
Logs and crash reports from the device
App console: Apple points to
devicectl help device process launchfor all launch options (for example--environment-variables). Per their READMEs, mcp-ios-device captures stdout, stderr andLogger/os_logoutput (ios_device_launch { capture_logs: true }, thenios_device_read_logs), and ios-device-mcp captures console logs on launch.Crash reports: Apple documents
devicectl device info files --device <id> --domain-type systemCrashLogs, thendevicectl device copy from …to pull a report to the Mac. Apple also documents a device mount point under~/Library/Developer/CoreDevice/DeviceFSwith aDiagnosticReportsfolder. mcp-ios-device exposesios_device_list_crash_logsandios_device_get_crash_log.Symbolicate before the agent reads it. Apple: unsymbolicated reports show hex addresses instead of function names;
.ipsis preferred over.crashwhen you share one. The Axiom plugin (on main) includes a crash-analysis agent.System log: Apple's route is Console.app with the device selected. pymobiledevice3 streams it from the CLI (
pymobiledevice3 syslog live); it is GPL-3.0, so it is not in the catalog.
FAQ
- Can Claude Code or Codex install my app on a real iPhone?
- Yes, after one manual setup: pair and trust the device, turn on Developer Mode and sign in to Xcode. Then the agent can build with xcodebuild and -allowProvisioningUpdates, and install and launch with xcrun devicectl device install app and device process launch.
- Why does xcodebuild say "Unable to find a device matching the provided destination specifier"?
- The id in -destination must be the hardware UDID. Older devicectl versions listed the CoreDevice identifier instead. Build with -destination 'generic/platform=iOS' and install with devicectl, or copy the UDID from Device Hub's Info inspector. Xcode 27's devicectl list devices shows the UDID when available.
- Can an agent turn on Developer Mode?
- No. Apple's steps run on the device: Settings, Privacy & Security, Developer Mode, restart, then confirm with the passcode. The switch only appears after pairing has started. Tools that drive the UI also need Settings, Developer, Enable UI Automation, according to the mcp-ios-device README.
- Which MCP servers can tap and take screenshots on a physical iPhone?
- Mobile MCP, agent-device, iCTRL, Appium MCP, mcp-ios-device, ios-device-mcp, ios-agent, mobctl and iPhone Mirror MCP are in the catalog. Most use WebDriverAgent or their own XCUITest runner, which you sign with your team. Maestro does not support physical iOS devices yet.
- How does an agent get crash logs from the device?
- Run xcrun devicectl device info files with --domain-type systemCrashLogs to list them, then devicectl device copy from to pull one to the Mac, and symbolicate before analysis. mcp-ios-device wraps this as list and get crash-log tools.