Test your iOS app with Codex
Check the iOS app Codex builds with xcodebuild through the local Mobster MCP server. It provides a headless simulator, screen outlines and a verdict. It checks the assertions declared before the run.
Add Mobster to Codex
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 Codex in Settings › Connectors. Or run curl -fsSL https://mobster.dev/install.sh | sh, then mobster mcp install codex. Either writes ~/:
[mcp_servers.mobster]command = "/ Applications/ Mobster.app/ Contents/ MacOS/ mobster-agent"args = ["mcp"]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 server is the agent inside Mobster for Mac, over stdio. Codex starts the MCP server as a child process on your Mac and communicates with it locally over stdio.
The Mobster MCP server is tested with Codex using the setup above.
The Codex page keeps this setup current, including how to give the server a model key for Smart mode.
It fits Codex’s timeout
Codex gives each tool call 60 seconds by default. The Mobster MCP server answers every tool within 45 seconds, and wait within 50. Longer work carries on under a run_id. Your first run on a Mac creates a separate simulator and boots it headless. It also builds WebDriverAgent once per Xcode version. During preparation, verify_start returns status: "preparing" and Codex calls wait until the run is ready. The server never opens Simulator.app or touches the simulators you created. On an M5 Max, first runs including preparation took 77.7 s and 103.6 s. Warm runs took 6.8 s and 8.6 s, as measured in AI end-to-end tests with assertions.
Tell Codex how to verify
Codex reads AGENTS.md. Put the verify loop there, 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.The build needs no signing team, and Mobster keeps build/ and runs/ out of your commits with a .mobster/.
Check the result against assertions
In the key-less loop Codex drives with its own model, and Mobster calls no model and needs no key. Mobster runs the app, reports the screen and judges. verify_start fixes the assertions before Codex touches the app. You check that the remaining count falls when you mark a task done in your app, using these tool calls:
{"tool": "verify_start", "arguments": { "app_path": "/ abs/ path/ YourApp/ .mobster/ build/ Build/ Products/ Debug-iphonesimulator/ YourApp.app", "launch_args": ["-SkipOnboarding", "YES"], "launch_env": {"SEED_TASKS": "3"}, "open_url": "yourapp://tasks", "steps": ["Tap the first task to mark it done."], "expect": [{"visible": {"id": "task_1", "selected": true}}, {"value": {"id": "done_count"}, "equals": 1}, {"value": {"id": "tasks_left"}, "equals": 2}]}}{"tool": "tap", "arguments": {"run_id": "…", "target": {"id": "task_1"}}}{"tool": "verify_finish", "arguments": {"run_id": "…"}}When the remaining count doesn’t fall, the check fails with value id=tasks_left == 2 failed: was "3 tasks left". The task is ticked and one task is under Done, but the remaining count still reads “3 tasks left”.
The verdict tells Codex what to fix
verify_finish returns one of four verdicts, each with an exit code for scripts: passed (0), failed (1), needs_review (2) and couldnt_run (3). With it comes the result JSON: summary names the first failing assertion, reason carries a fix sentence when there is one, and each failed assertion’s observed says what was on screen instead, with up to 5 near misses. On the build where the remaining count doesn’t fall:
✗ failed Marking a task done lowers the count (31.4 s) ✓ visible id=task_1 selected=true ✓ value id=done_count == 1 ✗ value id=tasks_left == 2: was "3 tasks left"The count line reports “3 tasks left”, giving Codex a specific failure to investigate.
Keep the check
save_check with a name saves the run’s check as .mobster/, plain YAML you can read and commit. The Checks reference has every field. A launch-only check reruns with no model and no key, so it suits a script:
mobster verify --check .mobster/ checks/ tasks-open.yaml --json > result.jsoncase $? in 0) echo "the task list opens" ;; 1) jq -r '.summary, .report' result.json; exit 1 ;; *) jq -r '.reason.message' result.json; exit 1 ;;esacA saved check whose recording still matches replays with no model call. Otherwise a check with steps reruns through Codex again, or through Smart, the built-in agent, on your own Claude or OpenAI API key, with the spend capped by --max-usd (default $0.25).
Give Codex a simulator
Get Mobster for Mac, then press Add next to Codex 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).
The full tool list is in the MCP reference, Getting started with verify runs a first check on the sample app, and Give Claude Code a real iPhone covers the phone side.
Questions
Can Codex use the iOS Simulator?
The Mobster MCP server gives Codex a headless iOS simulator that Mobster manages, and tools to read the screen, tap, type and swipe. Codex builds your app with xcodebuild.
Do the Mobster tools fit inside Codex's tool timeout?
Yes. Codex's default tool timeout is 60 seconds, and every Mobster tool call returns within 45 seconds, wait within 50. Longer work, such as a first simulator boot, carries on under a run_id that the agent polls with wait.
Can I rerun a check without Codex?
Yes. Save it with save_check or --save and run mobster verify --check. A launch-only check calls no model, and the exit code is the verdict. A saved check whose recording still matches replays with no model call. Live or healing steps need Codex again or Smart on your own Claude or OpenAI API key.



