mirror of
https://github.com/callstack/agent-device.git
synced 2026-09-14 20:06:34 +08:00
4da4745a6c1b09cd57ef245f731f891433019ec9
agent-device
Unified control CLI for physical and virtual devices (iOS + Android) for AI agents.
This project mirrors the spirit of agent-browser, but targets iOS simulators/devices and Android emulators/devices.
Current scope (v1)
- Platforms: iOS (simulator + limited device support) and Android (emulator + device).
- Core commands:
open,press,long-press,focus,type,fill,scroll,scrollintoview,screenshot,close. - Device tooling:
adb(Android),simctl/devicectl(iOS via Xcode). - Minimal dependencies; TypeScript executed directly on Node 22+ (no build step).
Install
npm install -g agent-device
Or use it without installing:
npx agent-device open Settings
Usage
agent-device <command> [args] [--json]
Examples:
agent-device open Settings
agent-device press 120 320
agent-device type "hello"
agent-device screenshot --out ./screenshot.png
agent-device close Settings
Flags:
--platform ios|android--device <name>--udid <udid>(iOS)--serial <serial>(Android)--out <path>(screenshot)--session <name>--verbosefor daemon and runner logs--jsonfor structured output
Sessions:
openstarts a session.- All interaction commands require an open session.
closestops the session and releases device resources. Pass an app to close it explicitly, or omit to just close the session.- Use
--session <name>to manage multiple sessions.
iOS simulator input:
- If
simctlinput is unavailable for your Xcode version, the CLI will use the XCTest runner to perform taps and scrolls.
App resolution
- Bundle/package identifiers are accepted directly (e.g.,
com.apple.Preferences). - Human-readable names are resolved when possible (e.g.,
Settings). - Built-in aliases include
Settingsfor both platforms.
iOS notes
- Input commands (
press,type,scroll, etc.) are supported only on simulators in v1. - Support depends on your Xcode version; the CLI reports
UNSUPPORTED_OPERATIONifsimctl iolacks input operations.
Testing
pnpm test
Build
pnpm build
Environment selectors:
ANDROID_DEVICE=Pixel_9_Pro_XLorANDROID_SERIAL=emulator-5554IOS_DEVICE="iPhone 17 Pro"orIOS_UDID=<udid>
Test screenshots are written to:
test/screenshots/android-settings.pngtest/screenshots/ios-settings.png
Contributing
See CONTRIBUTING.md.
Made with ❤️ at Callstack
agent-device is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. Callstack is a group of React and React Native geeks. Contact us at hello@callstack.com if you need any help with these technologies or just want to say hi.
Description
agent-device: Automates Apple-platform apps (iOS, tvOS, macOS), Android devices, and Amazon Vega OS TV apps in Vega Virtual Devices. Use when navigating apps, taking…; dogfood: Systematically explore and test a mobile app on iOS/Android with agent-device to find bugs, UX issues, and other problems. Use when asked to dogfood, QA,…; ios-simulator: Verify and debug native, React Native, Expo, or Flutter apps on an iOS Simulator with agent-device. Use when an agent needs to launch an app, inspect i…
adbagentic-aiagentsai-agentsandroid-emulatorautomatione2e-testingexpoflutterios-simulatormcpmobilemobile-testingperformance-optimizationreact-nativetestingxcuitest
Readme
MIT
170 MiB
Languages
TypeScript
94.1%
Swift
3.7%
JavaScript
0.9%
Objective-C
0.7%
Java
0.4%
Other
0.2%