Skip to content
SwiftSkills

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.

  1. 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 pair pairs a cabled device. Apple: a wirelessly paired device has to be paired again after an OS upgrade, and the device must be unlocked for devicectl commands.

  2. 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.

  3. 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.

  4. 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 device

The 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 -allowProvisioningUpdates and an Apple ID signed in to Xcode. "Signing requires a development team" means DEVELOPMENT_TEAM is 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_device in Appium MCP, ios-device-wda setup in mcp-ios-device, and IOS_DEVICE_MCP_TEAM_ID in 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 10004 after --terminate-existing is usually a false alarm. Check with devicectl device info processes before the agent rebuilds.

Tools that support a real iPhone

Only tools whose README states physical iOS support.

ToolHow it reaches the deviceInstall (from README)License★ (24 Oct)Last push
Mobile MCP (mobile-next)iOS real device over USB, "connected and trusted"; Android tooclaude mcp add mobile-mcp -- npx -y @mobilenext/mobile-mcp@latestApache-2.09,93618 Oct 2026
MobileBuildMCP (getsentry)Device build/run/test tools; needs code signing set up in Xcodenpx -y mobilebuildmcp@latest mcpMIT6,50422 Oct 2026
agent-device (callstack)XCTest for physical iOS interactions; also Androidnpm install -g agent-device@latestMIT5,12524 Oct 2026
iCTRL (OpenMinis)Long-running XCUITest runner on the phone, JSON-RPCSigned .ipa from releasesApache-2.055419 Oct 2026
run-device skill (rshankras)xcodebuild + devicectl, no UI drivingnpx skills add https://github.com/rshankras/claude-code-apple-skills --skill run-deviceMIT82624 Jul 2026 ⚠
simutil (dungngminh)devicectl; view, screenshots and recording onlybrew tap dungngminh/simutil + brew install --cask simutil-desktopMIT1,19822 Oct 2026
Appium MCP (appium)Appium XCUITest driver + WebDriverAgent, signed by appium_prepare_ios_real_deviceclaude mcp add appium-mcp -- npx -y appium-mcp@latestApache-2.050523 Oct 2026
mcp-ios-device (mgcrea)devicectl + WebDriverAgent; logs and crash reports; read-only unless IOS_DEVICE_ALLOW_WRITESnpx -y @mgcrea/mcp-ios-deviceMIT09 Oct 2026
ios-device-mcp (ChrisThoma)devicectl + long-running XCUITest runner over USBgit clone + npm install && npm run build + claude mcp add …MIT121 Oct 2026
ios-agent (emazaheri)WebDriverAgent; real iPhone over cable or Wi-FiMCP command uvx ios-mcp; check with uvx ios-mcp doctorMIT39 Oct 2026
podium-mcp (hoainho)devicectl lifecycle + opt-in WebDriverAgent (PODIUM_WDA_URL)/plugin marketplace add github:hoainho/podium-mcpMIT630 Jun 2026 ⚠
lazy_mobile_mcp (leaf76)devicectl launch/stop; WebDriverAgent for screenshots and tapsnpx -y lazy_mobile_mcp@latest setup-codexMIT119 Jul 2026 ⚠
baremobile (hamr0)WebDriverAgent over USBnpm install baremobileApache-2.01320 Sep 2026 ⚠
iPhone Mirror MCP (nickatnight96)macOS iPhone Mirroring (macOS 15+, iOS 18+)git clone + ./install.sh (README)MIT823 Oct 2026
simvyn (pranshuchittora)Dashboard/CLI; USB-connected physical devicesnpm install -g simvynMIT43920 Oct 2026
simwalk (Agulhas-Labs)simwalk walk … --device <udid> --team <team id>; parallel walks are simulator-onlybrew install agulhas-labs/tap/simwalkApache-2.0021 Oct 2026
mobctl (phamphamh)CLI over Appium + WebDriverAgent, USB; example agent skill filegit clone + ./scripts/up.sh + ./bin/mobctl session (README)MIT13 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 launch for all launch options (for example --environment-variables). Per their READMEs, mcp-ios-device captures stdout, stderr and Logger/os_log output (ios_device_launch { capture_logs: true }, then ios_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, then devicectl device copy from … to pull a report to the Mac. Apple also documents a device mount point under ~/Library/Developer/CoreDevice/DeviceFS with a DiagnosticReports folder. mcp-ios-device exposes ios_device_list_crash_logs and ios_device_get_crash_log.

  • Symbolicate before the agent reads it. Apple: unsymbolicated reports show hex addresses instead of function names; .ips is preferred over .crash when 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.