Skip to content
SwiftSkills

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 formatSwift test methods in a UI test targetYAML flows (appId, then commands such as tapOn, assertVisible)
PlatformsApple platformsAndroid, iOS and web from one CLI
iOS targetsSimulators and physical devicesXcode Simulators; README: "Physical iOS devices are not yet supported"
How it reaches the appSeparate 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)
WaitingExplicit, e.g. waitForExistence(timeout:)Built in: assertVisible retries for up to 7 s; extendedWaitUntil for longer
Agent edit loopEdit Swift → build → run (xcodebuild test -only-testing:); test-without-building skips rebuildsEdit YAML → run; no compile step. The MCP run tool accepts inline YAML
MCP for agentsXcode'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 setupe.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
PrerequisitesXcodeJava 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-failureretry command in flows; automatic retries on Maestro Cloud
Parallel runsXcode's parallel testing--shards / --shard-split across devices
System dialogs, other appsInteract with other apps via XCUIApplication(bundleIdentifier:)Docs: handles permission dialogs and multi-app journeys (e.g. Safari)
LicensePart 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 partsXcode 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, xcodebuild and 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 calls inspect_screen, runs a few YAML commands with run, takes a screenshot, and saves the flow that worked as a file. cheat_sheet hands 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 ./e2e drops 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

ToolSideWhat it doesInstall (from README)License★ (23 Oct)Last push
Maestro MCP (mobile-dev-inc)Maestromaestro mcp in the CLI: inspect, run YAML, screenshots, cloud runscurl -fsSL "https://get.maestro.mobile.dev" | bashApache-2.016,18022 Oct 2026
Maestro Mobile Testing Skill (foreztgump)MaestroSkill for writing Maestro flows for native iOS and other stacksnpx skills add foreztgump/maestro-mobile-testing-skillMIT19 Oct 2026
Manos (ryanperkins)MaestroExploratory MCP; records a session and exports a replayable Maestro flowclaude mcp add manos -- npx -y manos-mcp serveMIT318 Jun 2026
MobileBuildMCP (getsentry)XCUITesttest_sim, test_device with structured resultsnpx -y mobilebuildmcp@latest mcpMIT6,50222 Oct 2026
iOS Testing (ioloro)XCUITestXCUITest + Swift Testing skill, iostesting CLInpm install -g @ioloro/ios-testingMIT245 Aug 2026
Peekie (dodobrands)XCUITest.xcresult → JSON (tests, errors, coverage, attachments)mise use github:dodobrands/peekieApache-2.03221 Oct 2026
simless (abacusai)XCUITestRuns existing XCUITests without simulator clonesswift build -c release from a cloneApache-2.03322 Oct 2026
iCTRL (OpenMinis)XCUITestXCUITest runner on a real iPhone, JSON-RPC APISigned .ipa from releasesApache-2.055119 Oct 2026
axmcp (tmc)XCUITestxcmcp: test, GetTestList, RunSomeTestsgo install github.com/tmc/axmcp/cmd/xcmcp@latestMIT823 Sep 2026
iOS UI Testability Contract (Kofiloski)XCUITestScanner + skill for missing accessibility identifiers behind "element not found"uvx --from ios-ui-testability-contract ios-ui-testability ids <repo>MIT115 Jul 2026
SimWalk (Agulhas-Labs)XCUITestWalks screens in dark mode, large text, RTL; XCUITest-bundle runner, simwalk mcpbrew install agulhas-labs/tap/simwalkApache-2.0021 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.