CLI to control iOS and Android devices for AI agents
npx skills add https://github.com/callstackincubator/agent-device --skill dogfood使用 CLI 安装这个技能,并在你的工作区中直接复用对应的 SKILL.md 工作流。
agent-device is a CLI for UI automation and app observability on iOS, tvOS, macOS, Android, and AndroidTV. It is built for agent-driven workflows: inspect the UI, interact deterministically, collect logs/network/perf evidence when behavior breaks, and keep the whole flow session-aware and replayable.
If you know Vercel's agent-browser, this project applies the same broad idea to mobile apps and devices.
network dump, and sample CPU/memory with perf..ad scripts as a light e2e test suite..ad flows with --save-script, replay one script with replay, or run a folder/glob as a serial suite with test.test supports metadata-aware retries up to 3 additional attempts, per-test timeouts, flaky pass reporting, and runner-managed artifacts under .agent-device/test-artifacts by default. Each attempt writes replay.ad and result.txt; failed attempts also keep copied logs and artifacts when available.Use agent-device for on-device UI automation, screenshots/recordings, app logs, network inspection, and performance snapshots.
When the task needs the React component tree, props, state, hooks, or render profiling, pair it with the complementary agent-react-devtools project. The two tools solve different layers of the same debugging workflow.
The canonical loop is:
agent-device apps --platform ios
agent-device open SampleApp --platform ios
agent-device snapshot -i
agent-device press @e3
agent-device diff snapshot -i
agent-device fill @e5 "test"
agent-device press @e5
agent-device type " more" --delay-ms 80
agent-device close
In practice, most work follows the same pattern:
apps if the package or bundle name is uncertain.open a target app or URL.snapshot -i to inspect the current screen.press, fill, scroll, get, or wait using refs or selectors. On iOS and Android, default snapshot text follows the same visible-first contract: refs shown in default output are actionable now, while hidden content is surfaced as scroll/list discovery hints instead of tappable off-screen refs. If the target only appears in a hidden-content hint, use scroll <direction> and re-snapshot.rotate <orientation> when a flow needs a deterministic portrait or landscape state on mobile targets.diff snapshot or re-snapshot after UI changes.close when the session is finished.In non-JSON mode, core mutating commands print a short success acknowledgment so agents and humans can distinguish successful actions from dropped or silent no-ops.
For people:
For agents:
npm install -g agent-device
agent-device now performs a lightweight background upgrade check for interactive CLI runs and, when a newer package is available, suggests a global reinstall command. Updating the package also refreshes the bundled skills/ shipped with the CLI.
Set AGENT_DEVICE_NO_UPDATE_NOTIFIER=1 to disable the notice.
On macOS, agent-device includes a local agent-device-macos-helper source package that is built on demand for desktop permission checks, alert handling, and helper-backed desktop snapshot surfaces. Release distribution should use a signed/notarized helper build; source checkouts fall back to a local Swift build. Local helper overrides through AGENT_DEVICE_MACOS_HELPER_BIN must use an absolute executable path.
See CONTRIBUTING.md.
agent-device is an open source project and will always remain free to use. Callstack is a group of React and React Native geeks. Contact us at [email protected] if you need any help with these technologies or just want to say hi.