tests/checkout.test.yaml in the same diff,
runs it on a simulator or an emulator, reads the failed step, and fixes either
the test or the app. Reach for this setup when the agent already ships the
mobile change and you want the test in the same pull request.
The agent needs two things: the skills, which are local instruction files that
tell it which tools to call and in what order, and the MCP server, which is a
live process that gives it a device and the momentic_* tools. Neither one
touches the web momentic server, so a project with both a web app and a mobile
app keeps both entries in one config.
Prerequisites
- A testing-ready iOS build or
Android APK, uploaded with
npx momentic-mobile assets uploadto a channel and a tag momentic-mobileinstalled as a dev dependency, with amomentic.config.yamlfromnpx momentic-mobile init- A
MOMENTIC_API_KEYthat the MCP process can read. Most editors do not inherit your shell environment. Runnpx momentic-mobile loginso the server reads the saved key from~/.momentic/auth.json, or pass--with-api-keytoinstall-mcpfor a config that you do not commit.
Connect the agent
Install the skills and the MCP server from the project root. Both commands detect the coding agents on your machine and ask which ones to configure. Pass--yes to skip the prompt.
install-mcp writes a momentic-mobile server entry that runs
npx -y momentic-mobile mcp into the config of each agent, for example
.mcp.json for Claude Code, .cursor/mcp.json for Cursor and
.codex/config.toml for Codex. Restart the client and ask the agent which MCP
tools it has. It should list momentic_* tools. See
momentic-mobile install-mcp
for --client and the full table of agents, and
MCP for a manual config.
Ask for the test
Give the agent the flow and the build to test against, not the taps. A prompt that works in Claude Code, Cursor and Codex:tests/checkout.test.yaml
Close the loop
The agent does not stop at the file. It runs the test through the MCP server, and the result names the step that failed, with a screenshot of the screen at that moment. The agent reads that result and corrects its own change: a wrong label in the app, a missing wait in the test, or a step that the new screen no longer needs. Then it runs the test again. Before you push, run the same test from the CLI:lint validates the YAML the agent wrote. --upload-results sends the run to
the dashboard, where the video, the screenshots and the trace of the failing
step are available to link from the pull request. See
momentic-mobile run for
--channel, --tag and --parallel.
Gate the pull request
Run the branch’s mobile tests in CI against the build the job uploads, so the test and the app come from the same commit:.github/workflows/mobile-tests.yml
--channel dev --tag ${{ github.sha }} selects the asset this job uploaded.
Without it, the test falls back to defaultChannel and defaultTag and can run
against a stale build. A failed run exits non-zero and the check fails.
Notes
- Momentic runs iOS apps on simulators and Android apps on emulators. Real devices are not supported.
- Local iOS runs need
--parallel 1. Remote runs give each test its own session, so parallel runs are safe. - The MCP server ends a session after 5 idle minutes by default. Pass
--session-idle-timeout-minutestomomentic-mobile mcpto change it. - The skills and the MCP server are independent. Skills alone let the agent write valid YAML; the MCP server alone gives it a device without the instructions. Install both.