Baton
Let your agents drive iOS and Android apps through Maestro, Detox, XCUITest, Espresso and Compose, in parallel, without tripping over each other.
- Maestro
- Detox
- XCUITest
- Espresso & Compose
- iOS
- Android
- MCP for agents
What it's for
A harness for agents to drive your app
Baton wraps Maestro, Detox, XCUITest and Android instrumentation (Espresso, Compose) so agents can open your app, native or React Native, on a simulator or emulator, step through it, and come back with results and screenshots, all from one MCP or CLI call. It was built after parallel agents kept tripping over each other's port allocation and resources, so every worktree gets its own and the rest wait their turn. You follow along in the dashboard.
- ValidationCheck a change on a simulator or emulator before calling it done.
- TestingRun E2E suites, then rerun the failures until they pass.
- AuditingWalk through screens to review the UI and copy.
- EvidenceScreenshots from every run, ready for a pull request or review.
- Reproducing bugsScript the steps to a bug and watch it happen on a device.
- Not just for agentsDrive it yourself from the terminal or the menu bar, queued fairly alongside your agents.
See it in action
Many branches, one Mac that stays responsive
How it works
Every worktree gets its own devices, and its own Metro for React Native
Baton checks each React Native app loaded its own branch before a test runs, and leaves :8081 to you. Native apps skip Metro and still get their own devices and builds.
Why Baton
Built for parallel work, by people and agents
- A Metro per worktreeReact Native worktrees get their own port, so no simulator loads another branch's code. Native apps need none.
- Its own devicesDedicated simulators and emulators per worktree, so runs never share a device.
- Queued, not failedRuns wait for free devices instead of fighting over them.
- Built onceApp builds are cached by native fingerprint, so worktrees on the same native code share one, and JS-only branches never rebuild.
- Agent-readyOne MCP call runs the tests and returns results, screenshots and failure videos.
- Watch it liveA menu bar dashboard for watching agents' runs: progress, screenshots, logs and a live device grid. Switch to the Detailed view for run controls.
Install
Ready in one command
Downloads the latest release, checks its checksum and signature, installs Baton to Applications and puts the baton command on your PATH. Nothing else to do.
Installs the app and puts the baton command on your PATH. Then open Baton from Applications once: macOS asks before running an app downloaded from the internet, and baton waits for that.
- Download the DMG with the button above.
- Open it, accept the licence, and drag Baton to Applications.
- Open Baton and click Open if macOS asks. It lives in the menu bar, not the Dock.
- From the menu bar icon, choose Install 'baton' Command… to put
batonon your PATH.
Whichever you choose, Baton updates itself, and only when no test run is in progress.
Updating by hand
If Baton hasn't updated itself, or you've turned automatic updates off in Settings, update it in any of these ways:
- From the menu bar: click the Baton icon and choose Check for Updates… (Baton 1.3.0 and later). It downloads the latest version, installs it and restarts Baton, waiting for any test run to finish first.
- With Homebrew:brew upgrade --cask --greedy baton
- With the install script, which quits Baton and replaces it with the latest release:curl -fsSL https://lmcjt37.github.io/baton-releases/install.sh | sh -s -- --force
- By hand: download the DMG with the button above, quit Baton, then drag Baton to Applications and replace the old copy.
To remove it, run brew uninstall --zap --cask baton, or see uninstalling and troubleshooting.
Get started
Three commands to your first run
From your iOS, Android or React Native project:
Let your AI agents run tests too:
Requirements
macOS with Xcode and an iOS simulator runtime · a native (Swift, Kotlin), bare React Native or Expo dev-client app · one of: Maestro 2.11+ and Java; Detox 20 in your project (plus applesimutils for iOS); an XCUITest UI test target (Xcode 16+); Espresso or Compose tests with AndroidJUnitRunner · for Android, the Android SDK with an arm64 system image.
Good to know
Espresso and React Native don't mix: Espresso can't wait for React Native's JS thread, so Espresso tests of React Native screens need idling resources. Use Detox or Maestro for React Native apps; Compose UI tests are fine. See the limitations and troubleshooting guides.
