跪拜 Guibai
← All articles
GitHub · Open Source · Agent

Agent-Device: A Device Layer That Lets AI Agents Drive Simulators and Verify Their Own Code

By 狂师 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

The consequence is that the human no longer has to shuttle between an AI coding agent and a simulator: the agent itself launches the app, clicks, fills fields, and returns screenshots and logs for review. That removes a slow verification loop and gives other tools a blueprint for UI automation built on accessibility data instead of screenshot guessing.

Summary

agent-device closes the verification gap that leaves AI-written app code untested on actual UIs. When an agent has finished writing code, it can launch the app on a simulator or real device, read the interface through the accessibility tree, press buttons by element number, fill text fields, and check the UI diff after each step. Screenshots, logs, network requests, and performance traces are kept as evidence and can be dropped into a PR for human sign-off.

The device layer supports iOS, Android, HarmonyOS, tvOS, Android TV, Fire TV, and Amazon's Vega OS, with desktop automation for macOS and Linux and a basic Web layer. It handles native, React Native, Expo, and Flutter apps, and can run on local devices or connect to BrowserStack and AWS Device Farm for cloud hardware. Integration works through a pure CLI, a skills pack for agents that support it, or an MCP server, all sharing the same runtime.

Setup is straightforward but has prerequisites: Node.js 22.12+ (24+ for Web), Xcode for iOS, ADB for Android, and HarmonyOS tools. The `doctor` command should be run manually to confirm the environment. Platform support is uneven, with iOS and Android complete and HarmonyOS and Vega OS partial. iOS real devices require a developer certificate and Team ID. The authors position it as an exploration tool, not a regression runner; steps can be saved as `.ad` scripts for CI or exported to Maestro YAML.

Takeaways
— agent-device is MIT-licensed from Callstack, the React Native team behind react-native-paper, with about 5.4K stars and latest version v0.21.37.
— It reads the accessibility tree to produce numbered element lists, cutting token cost and improving click accuracy compared to vision-based screenshot interaction.
— Each operation returns a UI diff, letting the agent confirm whether a step succeeded; evidence includes screenshots, recordings, logs, network requests, and performance traces.
— Parallel agents get device occupancy declarations isolated by git worktree, so two agents never collide on the same simulator.
— Platform coverage spans iOS, Android, HarmonyOS, tvOS, Android TV, Fire TV, Vega OS, macOS, Linux, and basic Web; app stacks include native, React Native, Expo, and Flutter.
— Cloud device farms BrowserStack and AWS Device Farm are officially supported.
— Integration is via pure CLI, npx skills add callstack/agent-device for skills-capable clients, or an MCP stdio server; all share one runtime.
— Requires Node.js 22.12+ (24+ for Web automation), Xcode for iOS, ADB for Android, and HarmonyOS command-line tools.
— Run agent-device doctor yourself before handing over to an agent; the docs stress that skipping this produces a pile of errors.
— iOS and Android have full command coverage; HarmonyOS and Vega OS are partial; iOS real devices need a developer certificate and Team ID.
— It's an exploration/validation tool, not a regression suite; pass steps can be saved as .ad replay scripts for CI or exported to Maestro YAML.
Conclusions

Parsing the accessibility tree instead of taking screenshots is a deliberate trade: it trades away visual understanding for a token-light, exact coordinate-free representation that models can act on reliably. That's a design other UI automation tools can borrow.

The team openly positions agent-device as exploration, not regression, which sidesteps a common failure mode where AI tools are expected to produce deterministic test suites when they're better at improvising paths.

Including device occupancy and git worktree isolation recognizes that parallel agents are becoming a normal workflow; most AI coding tools don't address the coordination problem.

Concepts & terms
Accessibility tree
A structured representation of an app's UI elements that screen readers use; agent-device reads it to get a numbered list of buttons, text fields, and other controls instead of using screenshots.
MCP (Model Context Protocol)
An open protocol that lets AI models and agents interact with external tools and data sources over a standard interface; agent-device exposes an MCP server so clients can control devices.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗