Claude Code works in a terminal, and the iOS Simulator has a full command line interface. Put them together and the agent can build your app, put it on a simulated iPhone, look at the screen, and check its own work. This post shows the commands, a loop that works, and where the limits are.
Everything here needs a Mac with Xcode installed.
The tool: simctl
Apple’s simulator CLI is simctl, run through xcrun. Its built-in help (quoted below from Xcode 26) is the most reliable reference:
xcrun simctl help
The subcommands that matter for app testing:
list: show devices, runtimes and device types.bootandshutdown: start or stop a device.installandlaunch: put a built.appon a device and start it.terminate: stop the app.openurl: open a URL on the device, which is how you test deep links.push: “Send a simulated push notification.”io: take screenshots and record video.privacy: grant or revoke permissions such as photos or location.status_bar: override the status bar, useful for clean store screenshots.erase: wipe a device back to a fresh state.
Most commands accept booted in place of a device ID, which targets the device that is already running.
Setup checklist
If you build with Flutter, the Flutter docs list the one-time Xcode setup:
sudo sh -c 'xcode-select -s /Applications/Xcode.app/Contents/Developer && xcodebuild -runFirstLaunch'
xcodebuild -downloadPlatform iOS
Then open the simulator. On Xcode 26 or earlier that is open -a Simulator. The Flutter docs note the app is renamed Device Hub in Xcode 27, opened with open -a DeviceHub.
Add a short section to your CLAUDE.md so Claude knows your defaults:
## Simulator
- Default device: iPhone 16 (boot it if nothing is booted)
- Bundle ID: com.example.myapp
- Run: flutter run -d <device_id>
- Screenshots go in /tmp/shots, never in the repo
Run the app
Flutter
The Flutter docs give the basic pair:
flutter devices
flutter run -d <device_id>
Claude can run flutter devices, pick the simulator, and start the app. Since flutter run stays attached, ask Claude to run it in the background so it can keep working, or run it yourself in a second terminal.
SwiftUI and native
For a native project, Claude builds with xcodebuild and then installs and launches with simctl:
xcrun simctl boot "iPhone 16"
xcrun simctl install booted path/to/MyApp.app
xcrun simctl launch booted com.example.myapp
Our Claude Code with SwiftUI post covers the build side in more detail.
Let Claude see the screen
This is the step that changes how useful the agent is. Take a screenshot:
xcrun simctl io booted screenshot /tmp/shots/home.png
The default format is PNG. Claude Code’s docs say you can give it an image by path, drag and drop, or paste, and they show prompts like “Describe the UI elements in this screenshot”. Once Claude can read the file, it can compare the screen to your design, spot clipped text, or confirm a bug is gone.
A practical loop:
- Claude makes a change.
- Claude rebuilds or hot reloads.
- Claude takes a screenshot and reads it.
- Claude reports what it sees and fixes anything wrong.
For motion bugs, xcrun simctl io booted recordVideo /tmp/shots/flow.mp4 records the screen. Apple’s guide says “To stop recording, press Control-C in Terminal,” so you will stop it yourself.
Test the hard-to-reach paths
Push notifications
Create a payload file and send it:
{
"aps": {
"alert": { "title": "Order shipped", "body": "Your order is on its way" }
},
"orderId": "123"
}
xcrun simctl push booted com.example.myapp payload.json
The built-in help sets the rules: the payload must “Contain an ‘aps’ key with valid Apple Push Notification values” and “Be 4096 bytes or less.” It also says “Only application remote push notifications are supported.” This tests your app’s handling of a notification. It does not test your server or APNs. For that side, see Flutter push notifications with Firebase.
Deep links
xcrun simctl openurl booted "myapp://orders/123"
Ask Claude to open each route in your app this way and screenshot the result. It is a quick check that your router handles every path. The go_router deep links guide explains the setup.
Permissions
xcrun simctl privacy grants, revokes or resets permissions for a bundle ID. The help text says reset means “prompting on next use,” so you can replay a first-run permission prompt without reinstalling. Run xcrun simctl help privacy for the list of services on your Xcode version.
A clean slate
xcrun simctl erase <device> wipes a device. Use it before testing onboarding, so you see what a new user sees.
Xcode’s MCP tools
Since Xcode 26.3, Apple lets outside agents use Xcode’s own tools through MCP. Apple’s newsroom post says the release brings “coding agents such as Anthropic’s Claude Agent and OpenAI’s Codex” and that agents can verify work by “capturing Xcode Previews and iterating through builds and fixes.”
To connect Claude Code, turn on “Allow External Agents to Use Xcode Tools” in Xcode’s Intelligence settings, then run:
claude mcp add --transport stdio xcode -- xcrun mcpbridge
claude mcp list
Apple’s doc adds: “Before prompting an external agent (outside of Xcode), be sure to open your project in Xcode.” This route is most useful for native SwiftUI projects. For Flutter, simctl plus flutter run covers most needs, and the Dart MCP server adds hot reload and runtime errors.
Limits to keep in mind
- The simulator is not a phone. Performance, camera, real push delivery and some hardware features differ. Test on a device before release.
- Claude cannot tap. simctl launches apps, opens URLs and takes screenshots, but it is not a UI test runner. For tapping through flows, write integration tests or use a tool built for that. See testing a Flutter app with Claude Code.
- Screenshots cost context. Each image adds tokens. Take them at checkpoints, not after every line change.
Where this fits
Simulator access is one piece of an agent-driven workflow. The Claude Code mobile app development guide covers the rest: specs, rules, builds and release. When you are ready for real devices and testers, the TestFlight beta testing guide is the next step. MobileKit’s QA skill fits on top of this screenshot loop if you want a ready checklist.
Sources read on the day this post was written: Apple: Simulator Guide, Interacting with the Simulator, Flutter docs: Set up iOS development, Claude Code docs: Common workflows, Apple: Giving external agents access to Xcode and Apple Newsroom: Xcode 26.3.