Maestro vs XCUITest for AI agents: which to pick for iOS UI tests
Pick XCUITest when tests must run on real iPhones, live in Swift beside your app and run in Xcode or Xcode Cloud. Pick Maestro when an agent should check flows quickly: maestro mcp is built into the free CLI and flows are plain YAML, but on iOS it runs on simulators only. Many teams use both.
Last updated:
Decision table
| XCUITest (XCTest + XCUIAutomation) | Maestro | |
|---|---|---|
| Test format | Swift test methods in a UI test target | YAML flows (appId, then commands such as tapOn, assertVisible) |
| Platforms | Apple platforms | Android, iOS and web from one CLI |
| iOS targets | Simulators and physical devices | Xcode Simulators; README: "Physical iOS devices are not yet supported" |
| How it reaches the app | Separate test runner that launches and drives the app (XCUIApplication) | Black-box via the accessibility layer, through a small companion driver app on the device; the iOS driver in the repo is an XCTest runner (maestro-ios-xctest-runner) |
| Waiting | Explicit, e.g. waitForExistence(timeout:) | Built in: assertVisible retries for up to 7 s; extendedWaitUntil for longer |
| Agent edit loop | Edit Swift → build → run (xcodebuild test -only-testing:); test-without-building skips rebuilds | Edit YAML → run; no compile step. The MCP run tool accepts inline YAML |
| MCP for agents | Xcode's MCP server (GetTestList, RunSomeTests, RunAllTests) while Xcode runs; third-party servers such as MobileBuildMCP (test_sim, test_device) | maestro mcp ships inside the CLI: inspect_screen, take_screenshot, run, cheat_sheet, cloud tools, open_maestro_viewer |
| Agent setup | e.g. npx -y mobilebuildmcp@latest mcp, or Xcode's MCP bridge (see setup guides) | claude mcp add maestro -- maestro mcp · codex mcp add maestro -- maestro mcp · gemini mcp add maestro maestro mcp |
| Prerequisites | Xcode | Java 17+ (JAVA_HOME), Xcode Command Line Tools for iOS |
| Results for CI | .xcresult bundle; xcrun xcresulttool get test-results gives JSON | --format junit (or html, html-detailed) with --output; --test-output-dir for screenshots and logs |
| Flaky tests | -retry-tests-on-failure, -run-tests-until-failure | retry command in flows; automatic retries on Maestro Cloud |
| Parallel runs | Xcode's parallel testing | --shards / --shard-split across devices |
| System dialogs, other apps | Interact with other apps via XCUIApplication(bundleIdentifier:) | Docs: handles permission dialogs and multi-app journeys (e.g. Safari) |
| License | Part of Xcode (Apple developer tools, not open source) | CLI and MCP: Apache-2.0. Maestro Studio Desktop: free but "not an open-source project" |
| Optional paid parts | Xcode Cloud (Apple's hosted CI) | Maestro Cloud: "$250/device/mo" on maestro.dev/pricing (23 Oct 2026), priced by max concurrent executions; free 7-day trial. Enterprise: custom pricing |
When to pick XCUITest
You need real devices. XCUITest runs on connected iPhones and iPads; Maestro does not support physical iOS devices yet.
Tests should live with the code. UI tests are Swift in your Xcode project, reviewed with your app, and run by Xcode,
xcodebuildand Xcode Cloud without another runtime.You use Xcode's own agents. Xcode's MCP server exposes test listing and running, so Claude Agent or Codex in Xcode, and external agents through the bridge, can run your existing tests. Setup: Xcode agents setup guide.
You need deep app access. Launch arguments, environment and in-process test helpers stay in Swift.
The step-by-step agent workflow (write, -only-testing, .xcresult, flaky tests) is in iOS UI testing with AI agents.
When to pick Maestro
The agent should check a flow now. With
maestro mcp, the agent callsinspect_screen, runs a few YAML commands withrun, takes a screenshot, and saves the flow that worked as a file.cheat_sheethands it the command syntax.You ship Android and iOS (or React Native, Flutter): one YAML flow format for both.
Non-Swift reviewers. YAML flows are short and readable; built-in waiting means less timing code for the agent to get wrong.
CI wants JUnit.
maestro test --format junit --output build/report.xml ./e2edrops into most CI dashboards.
Limits to plan for: iOS simulators only, Java 17+, and the official GitHub Action and other CI integrations in Maestro's docs are for Maestro Cloud. Locally and on your own runners the CLI is free.
Using both
They don't exclude each other, and both read the accessibility tree. Give elements stable .accessibilityIdentifier() values (Maestro's SwiftUI docs recommend it too) and both can target them. A common split: XCUITest for the regression suite in Xcode or Xcode Cloud and on devices; Maestro MCP for the agent's quick checks and for cross-platform smoke flows.
Tools in the catalog for each side
| Tool | Side | What it does | Install (from README) | License | ★ (23 Oct) | Last push |
|---|---|---|---|---|---|---|
| Maestro MCP (mobile-dev-inc) | Maestro | maestro mcp in the CLI: inspect, run YAML, screenshots, cloud runs | curl -fsSL "https://get.maestro.mobile.dev" | bash | Apache-2.0 | 16,180 | 22 Oct 2026 |
| Maestro Mobile Testing Skill (foreztgump) | Maestro | Skill for writing Maestro flows for native iOS and other stacks | npx skills add foreztgump/maestro-mobile-testing-skill | MIT | 1 | 9 Oct 2026 |
| Manos (ryanperkins) | Maestro | Exploratory MCP; records a session and exports a replayable Maestro flow | claude mcp add manos -- npx -y manos-mcp serve | MIT | 3 | 18 Jun 2026 |
| MobileBuildMCP (getsentry) | XCUITest | test_sim, test_device with structured results | npx -y mobilebuildmcp@latest mcp | MIT | 6,502 | 22 Oct 2026 |
| iOS Testing (ioloro) | XCUITest | XCUITest + Swift Testing skill, iostesting CLI | npm install -g @ioloro/ios-testing | MIT | 24 | 5 Aug 2026 |
| Peekie (dodobrands) | XCUITest | .xcresult → JSON (tests, errors, coverage, attachments) | mise use github:dodobrands/peekie | Apache-2.0 | 32 | 21 Oct 2026 |
| simless (abacusai) | XCUITest | Runs existing XCUITests without simulator clones | swift build -c release from a clone | Apache-2.0 | 33 | 22 Oct 2026 |
| iCTRL (OpenMinis) | XCUITest | XCUITest runner on a real iPhone, JSON-RPC API | Signed .ipa from releases | Apache-2.0 | 551 | 19 Oct 2026 |
| axmcp (tmc) | XCUITest | xcmcp: test, GetTestList, RunSomeTests | go install github.com/tmc/axmcp/cmd/xcmcp@latest | MIT | 8 | 23 Sep 2026 |
| iOS UI Testability Contract (Kofiloski) | XCUITest | Scanner + skill for missing accessibility identifiers behind "element not found" | uvx --from ios-ui-testability-contract ios-ui-testability ids <repo> | MIT | 1 | 15 Jul 2026 |
| SimWalk (Agulhas-Labs) | XCUITest | Walks screens in dark mode, large text, RTL; XCUITest-bundle runner, simwalk mcp | brew install agulhas-labs/tap/simwalk | Apache-2.0 | 0 | 21 Oct 2026 |
Agent-driven simulator tools that are neither framework (mobile-mcp, agent-device, Testa and others) are compared in iOS simulator MCP servers.
FAQ
- Is Maestro better than XCUITest for AI agents?
- For quick agent checks, often yes: flows are YAML with no compile step, waiting is built in, and maestro mcp ships with the CLI. XCUITest is the better base when tests must run on real devices, live in Swift with the app, or run in Xcode and Xcode Cloud.
- Does Maestro support real iPhones?
- Not yet. Maestro's README says physical iOS devices are not yet supported; on iOS it runs on Xcode Simulators. XCUITest runs on both simulators and connected devices.
- Is Maestro free?
- The Maestro CLI, including the MCP server, is open source under Apache-2.0 and free. Maestro Studio Desktop is free but not open source. Maestro Cloud, the optional hosted device service, listed $250 per device per month on 23 Oct 2026, with a free 7-day trial.
- How does an AI agent use Maestro?
- Add the MCP server with claude mcp add maestro -- maestro mcp (Codex and Gemini have equivalent commands). The agent can list devices, inspect the screen, run inline YAML or flow files, take screenshots and, with a Maestro Cloud login, run flows in the cloud.
- Can I use Maestro and XCUITest together?
- Yes. Both find elements through accessibility, so stable accessibility identifiers serve both. Keep the regression suite in XCUITest for Xcode, Xcode Cloud and devices, and use Maestro for agent checks and cross-platform smoke flows.