Baton

Let your agents drive iOS and Android apps through Maestro, Detox, XCUITest, Espresso and Compose, in parallel, without tripping over each other.

Download for macOS Free · macOS · All releases
Baton - Agent first dev tool for visual testing harnesses with RN | Product Hunt

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.

See it in action

Many branches, one Mac that stays responsive

Six worktrees run their tests at once: four iOS simulators fill the budget while a fifth worktree waits in the queue, an Android emulator runs alongside, and a chart shows device memory rising and then falling
Six worktrees, a budget of four simulators: extra runs queue instead of booting more devices, and the memory comes back when the work ends.
Two Claude Code sessions run their worktrees' tests on iOS and Android through Baton's MCP server, while the dashboard shows both runs live
Agents run the tests over MCP and get the results back; you watch on the dashboard.
A tour of the dashboard: live devices, a failure screenshot in the lightbox, a failure video, logs, and Encore in the Detailed view
Live devices, failure screenshots and videos, logs, and Encore to rerun what failed.

Click a clip to watch it full size.

How it works

Every worktree gets its own devices, and its own Metro for React Native

Why Baton

Built for parallel work, by people and agents

Install

Ready in one command

curl -fsSL https://lmcjt37.github.io/baton-releases/install.sh | sh

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.

brew install --cask lmcjt37/tap/baton

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.

  1. Download the DMG with the button above.
  2. Open it, accept the licence, and drag Baton to Applications.
  3. Open Baton and click Open if macOS asks. It lives in the menu bar, not the Dock.
  4. From the menu bar icon, choose Install 'baton' Command… to put baton on 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:

  1. 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.
  2. With Homebrew:
    brew upgrade --cask --greedy baton
  3. 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
  4. 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:

baton init # detect your project, write baton.config.ts baton perform # run your Maestro flows, Detox, XCUITest or Espresso tests baton ui # open the dashboard

Let your AI agents run tests too:

claude mcp add --scope user baton -- baton mcp

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.

Learn more