Duyệt miễn phí mỗi ngày. Lên Pro để cài đặt và dùng Airsc MCP không giới hạn.

Xem gói Pro
MCP serverAn toànKiểm thử & sửa lỗiCần cài đặt chút

agent-device

callstack · callstack/agent-device

Cho phép agent điều khiển, kiểm tra và xác minh ứng dụng di động trên trình giả lập iOS/Android hoặc thiết bị thật.

Mobile app automation and verification for AI coding agents. CLI, MCP server, and typed Node.js API for iOS, Android, HarmonyOS, TV, web, macOS, and Linux.

5.1k sao339Giấy phép: MITCập nhật Hôm qua0 lượt mở

Xem kết quả thực tế

Agent AI tự động hóa ứng dụng Danh bạ iOS thông qua CLI của agent-device

Ảnh từ README của tác giảAgent AI tự động hóa ứng dụng Danh bạ iOS thông qua CLI của agent-device

Ảnh từ README của tác giả callstack ·Nguồn

Bạn có thể làm gì với nó

  • Xác minh thay đổi UI mới hiển thị chính xác trên nhiều kích thước màn hình
  • Tự động thực hiện luồng đăng nhập để gỡ lỗi xác thực
  • Ghi lại bằng chứng về lỗi trên thiết bị thật để báo cáo lỗi

Kiểm tra an toàn

An toàn

Không thấy dấu hiệu rủi ro trong các file đã quét.

Quét tự động các file trong repo. Luôn xem lại code trước khi chạy.

Trích từ README


agent-device

Mobile app automation and verification for AI coding agents. Give coding agents a live app feedback loop through a CLI, built-in MCP server, or typed Node.js API.

Let your coding agent verify its changes in the running app. agent-device lets agents inspect, control, debug, and verify apps on iOS, Android, and HarmonyOS (simulators, emulators, and physical devices), plus tvOS, Android TV, Amazon Vega OS TV (Vega Virtual Device), web, macOS, and Linux. Agents read token-efficient accessibility snapshots instead of reasoning over screenshots alone, act through refs and selectors, and save evidence for review. It also coordinates device access across parallel agent worktrees and connects to remote device clouds.

Works with Claude Code, Codex, Cursor, Windsurf, Cline, Goose, and any agent that can run a CLI or connect over MCP, or as the runtime under agents you build with the AI SDK or Eve. Developers at Expensify, Shopify, and others use it to verify their apps.

agent-device powers mobile automation in

e2e

and

T3 Code.

Quick start

Install the CLI and check setup. It requires Node.js 22.12 or newer; web automation requires Node.js 24 or newer. See Installation for target requirements.

npm install -g agent-device@latest
agent-device doctor
agent-device help workflow

Run doctor yourself before you hand the CLI to an agent. help workflow links to the guides for debugging, replay, and profiling.

Drive an app from the CLI

Add a contact in the built-in iOS Contacts app:

# Start a session.
agent-device open Contacts --platform ios

# Inspect the screen. The example below shows the output; refs vary.
agent-device snapshot -i
# @e2 [button] "Add"

# Use the ref and wait for the UI to settle.
agent-device press @e2 --settle
# The diff includes:
# + @e7 [text-field] "First name"

agent-device fill @e7 "Ada" --settle
# The next diff shows changed values and current refs:
# - @e7 [text-field] "First name"
# + @e14 [text-field] "Ada"
# = @e15 [text-field] "Last name"

# Capture evidence and close the session.
agent-device screenshot ./contact-form.png
agent-device close

Refs are valid only in the latest output: after a --settle command, use the refs in its diff, and take a new snapshot only if the diff omits what you need. Snapshots come from the app's accessibility tree, so clear labels, roles, and test IDs make agent runs more reliable; use screenshots and video as evidence or when accessibility data is poor.

Add MCP tools to your agent

agent-device mcp starts the official stdio MCP server, exposing the installed commands as structured tools over the same execution path as the CLI:

{
  "mcpServers": {
    "agent-device": {
      "command": "agent-device",
      "args": ["mcp"]
    }
  }
}

See AI Agent Setup for per-client setup and when to prefer plain CLI over MCP.

Script it from Node.js

createAgentDeviceClient() gives Node.js code typed access to the same commands, as model tools in your own agent or from orchestration code:

import { createAgentDeviceClient } from 'agent-device';

const client = createAgentDeviceClient({ session: 'qa-run' });
try {
  await client.apps.open({ app: 'com.apple.Preferences', platform: 'ios' });
  const snapshot = await client.capture.snapshot({ interactiveOnly: true });
  const button = snapshot.nodes.find((node) => node.role === 'button');
  if (button) await client.interactions.press({ ref: button.ref });
} finally {
  await client.sessions.close();
}

See the Node.js API, the runnable examples, and the AI SDK and Eve integration guides.

What agents can do

  • Inspect app state through accessibility snapshots, refs, and selectors, and profile React Native renders to find what makes an interaction slow.
  • Act on visible UI by tapping or pressing elements, filling fields, scrolling, making gestures, waiting, asserting state, and handling alerts.
  • Diagnose failures with screenshots, video, logs, traces, network data, performance samples, crash details, and React profiles.
  • Repeat workflows by saving working steps as .ad scripts for local use or CI. Export strict Maestro YAML when needed.

See Commands for the commands and evidence each target supports.

What to ask your agent

With the CLI installed, prompts like these work end to end:

  • "Implement the onboarding screen, run it on the iOS simulator and Android emulator, and attach screenshots."
  • "Reproduce this crash and capture the logs that lead up to it."
  • "Check whether this change causes unnecessary React Native re-renders."
  • "Explore the checkout flow once, save it as a replay script, and run it in CI."
  • "Verify this pull request on a physical device and attach reviewable evidence."

Next steps

Xem mã nguồn trên GitHub