Skip to content

Give Claude Code a real iPhone

Claude Code can build SwiftUI screens with xcodebuild. The Mobster MCP server lets it read labeled controls, tap, type and swipe, then check assertions fixed before the run. The MCP server runs locally. Claude Code sends the screen content it uses to its AI provider.

Connect it with one button

On a Mac with Apple silicon, macOS 13 or later, and Xcode with an iOS Simulator runtime, get Mobster for Mac, open it, and press Add next to Claude Code in Settings › Connectors. Or add it from a terminal:

curl -fsSL https://mobster.dev/install.sh | shmobster mcp install claude-code

To set up your iPhone and to build and test your own app, you need the macOS your Xcode version needs (Apple lists it on its Xcode page).

The Claude Code plugin adds the mobster skill too, which teaches Claude Code the verify loop: /plugin marketplace add RadishSoftware/mobster-plugin, then /plugin install mobster@mobster. Mobster in Claude Code keeps the setup current, including the key for Smart mode.

What Claude Code sees

The screen comes back as an outline built from the accessibility tree, the labelled controls VoiceOver reads. TaskListView in a made-up to-do app, as screen returns it:

Screencom.example.yourapp402×874 ptkeyboard: nonealert: none

  1. e1text"Tasks"id=tasks_title
  2. e2text"3 tasks left"id=tasks_left
  3. e3button"Water the plants"value="To do"id=task_1
  4. e4button"Call the bank"value="To do"id=task_2
  5. e5button"Book the dentist"value="To do"id=task_3
  6. e6button"Add a task"id=add_task
  7. e7button"Clear done"disabledid=clear_done

Claude Code taps by ref or by selector: tap with {"target": {"id": "task_1"}} taps “Water the plants”, and the next outline shows it selected and Clear done no longer disabled. Labels arrive as text, and counts and switch states as values, so the agent can use those values directly. A ref is good until the screen changes, and a tap on an old ref says so.

Start on a simulator

Start on a simulator without Developer Mode, an Apple ID or signing. On the first check, Mobster looks at Xcode, the runtime and free disk space, creates a dedicated simulator, boots it headless and builds WebDriverAgent once per Xcode version. It never opens Simulator.app and never touches the simulators you made yourself. On an M5 Max with Xcode 26.4, a first launch-only check with that preparation took 77.7 s and 103.6 s, and warm runs took 6.8 s and 8.6 s, as measured in AI end-to-end tests with assertions.

The server never makes Claude Code wait on a long call. Every tool returns within 45 seconds, and wait within 50. While a call waits, the server sends a progress notification every 5 seconds, for clients that use it to keep a long call alive.

The verify loop

Claude Code states what must be true before it touches the app, then drives, then gets a verdict it didn’t write.

  1. Build. xcodebuild -scheme <Scheme> -destination 'generic/platform=iOS Simulator' -derivedDataPath .mobster/build CODE_SIGNING_ALLOWED=NO build. No signing team is needed.
  2. Start. verify_start takes the absolute app_path, the steps in plain English, and expect: the accessibility-tree assertions Mobster checks at verify_finish. They’re fixed now.
  3. Drive. Claude Code reads the outline and acts. Each action returns the new screen.
  4. Finish. verify_finish checks the declared assertions and returns the verdict and report path, with an overlay frame when available.
  5. Fix and repeat. On failed, Claude Code fixes the code, rebuilds and verifies again.

A real key-less session on a sample app’s onboarding, from scripts/mcp_smoke.py on 28 September 2026, with the simulator already up and the app renamed YourApp. Each line is a tool call, how long it took, and the first line it returned:

  1. verify_start3.94 sRun 20260928-151841-816e is ready. Drive the app with the refs below, then call verify_finish.
  2. tap1.86 sTapped “Continue”; the screen changed.
  3. tap2.13 sTapped “Continue”; the screen changed.
  4. tap1.89 sTapped “Turn on reminders”; the screen didn't change.
  5. screen0.46 sScreen com.example.yourapp 402×874 pt keyboard: none alert: "“YourApp” Would Like to Send You Notifications …"
  6. alert2.13 sDismissed the alert "“YourApp” Would Like to Send You Notifications …".
  7. tap4.13 sTapped “Get started”; the screen changed.
  8. wait_for4.50 sAll 1 hold (4.5 s).
  9. verify_finish3.07 spassed Complete onboarding. Don't allow notifications. (24.1 s)

A failed run says what was on screen instead.

Mobster checks saved assertions. AI end-to-end tests for iOS explains the rules. To ask Claude Code to verify each UI change, put this in CLAUDE.md, with your scheme and app names:

## Verifying UI changesAfter you change a screen in this iOS app, verify it before you say it works.1. Build for the simulator:   xcodebuild -scheme <Scheme> -destination 'generic/platform=iOS Simulator' -derivedDataPath .mobster/build CODE_SIGNING_ALLOWED=NO build2. Call mobster's verify_start with app_path set to the absolute path of   .mobster/build/Build/Products/Debug-iphonesimulator/<App>.app, the steps in plain English, and expect:   what must be true when the steps are done.3. Drive with screen, tap, type_text and swipe, then call verify_finish.4. If the verdict is failed, fix the code and verify again. Report the verdict and the report path.

Keep a check for later runs: save_check writes the run’s check to .mobster/checks as plain YAML, and mobster verify --check reruns it.

Then your iPhone

Use a simulator to check layout and logic. Use an iPhone for its real keyboard and the build your users run. Mobster drives an iPhone over USB through WebDriverAgent, an XCTest runner, so the iPhone needs Developer Mode on, the Mac needs Xcode signed in to an Apple ID, and the runner must be signed for that phone. A free Apple ID works. Use Mobster for Mac to build, sign and renew the runner. Without the app window, follow the same steps with mobster serve --manage-device, using the open-source mobster command, which also comes with Mobster for Mac (Device setup).

Claude Code has completed read-only tasks on a USB iPhone through these tools:

  • Find it. list_devices returns every device Mobster can use: USB iPhones, managed simulators and WebDriverAgent addresses, each with its state.
  • Drive it. screen, tap, type_text, swipe, alert, open_url, launch_app and home called with device and no run_id drive that device directly.
  • Share it. Mobster takes the device’s lock on the first call, so no other Mobster app or command drives it meanwhile, and stop or 90 idle seconds releases it. A real iPhone’s frames go to the Mobster data folder, so your phone’s screens never land in the repository.
  • Keep it to the phones you choose. mobster mcp install claude-code --allow-device "Test iPhone" refuses every other real device. A saved check’s device: may name only a simulator, so a check file in a repository never drives someone’s phone.

On a real iPhone, the Mac app asks for approval before sending, buying, posting or deleting through MCP, and Claude Code cannot approve the action. The server also tells Claude Code to treat screen text as data, not instructions. When the phone is locked, a call fails at once with “Your iPhone is locked. Unlock it and try again. No action was taken.” For a sign-in code sent by text or email, use_code types the code into the code field without Claude Code ever seeing it.

Every tool carries an MCP annotation that marks it as read-only or acting, so a client that asks before acting calls asks before taps and typing.

Give Claude Code the screen

Get Mobster for Mac, then press Add next to Claude Code in Settings › Connectors. The app also sets up your iPhone, with a live view and approvals, for free (AI runs on a supported AI plan, an API key or a model on your Mac).

Other MCP clients are set up the same way: the Connectors page has each one, and the Developers page has the plugin and the skill.

Questions

  • Can Claude Code control an iPhone?

    Yes, through an MCP server. With the Mobster server added (Settings › Connectors › Add in Mobster for Mac), Claude Code reads each screen's accessibility tree and taps, types and swipes on an iOS simulator Mobster manages. The same tools are documented for an iPhone plugged into your Mac.

  • Does Claude Code need a model key to use Mobster?

    No. Claude Code uses its own model access when it drives the Mobster tools. Mobster makes no additional model call in that loop. Launch-only checks also need no model key. Smart checks use your Claude or OpenAI API key.

  • Do I need Developer Mode to try it?

    Not on a simulator. Mobster builds its simulator runner without an Apple ID or signing team. A real iPhone needs Developer Mode on the phone, Xcode signed in to an Apple ID, and a signed WebDriverAgent runner, which Mobster for Mac sets up for you.

  • Can Claude Code test UI?

    For an iOS app, yes, with an MCP server. Through Mobster, Claude Code runs your app on a simulator and taps through screens by element name. Mobster checks saved assertions and returns a verdict with frames when available.

  • Can Claude Code test on a physical device?

    Yes, on your iPhone over USB. With the Mobster MCP server, Claude Code opens your app on the phone, taps through it and reads each screen. On a real iPhone, the Mac app asks before anything is sent, bought, posted or deleted, and Claude Code cannot approve the action for you.

Sources