代理设备
- 作者仓库星标 4,864
- 作者仓库 App
- 领域
- 人工智能
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @Expensify · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- macOS · Linux · Windows
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
# agent-device
## Pre-flight (auto)
These checks evaluate at skill load. If any line shows `FAIL`, stop and surface the fix before running any device command.
`agent-device` version: !`R=0.13.0; V=$(agent-device --version 2>/dev/null); [ -n "$V" ] && [ "$(printf '%s\n%s\n' "$R" "$V" | sort -V | head -1)" = "$R" ] && echo "OK ($V)" || echo "FAIL (need v$R+, got: ${V:-not installed}). Fix: npm install -g agent-device@latest"`
Bundled CLI skills dir: !`D="$(npm root -g)/agent-device/skills/agent-device"; test -s "$D/SKILL.md" && echo "OK ($D)" || echo "FAIL (missing $D/SKILL.md). Fix: npm install -g agent-device@latest"`
HybridApp mode: !`M=$(scripts/is-hybrid-app.sh 2>/dev/null | tail -1); [ "$M" = "true" ] && echo "OK (HybridApp)" || echo "FAIL (got: ${M:-unknown}). This skill only supports the HybridApp build - ensure the Mobile-Expensify submodule is present."`
## Bring-up
Run this sequence the first time the user asks for device interaction in a session, before any `open` / `snapshot` / `replay`.
### 1. Platform
If the user prompt names `ios` or `android` explicitly, use it. Otherwise ask. Only iOS and Android are supported; reject other platforms.
### 2. Bundle ID
HybridApp dev builds only (the pre-flight gate enforces this).
| Platform | Bundle ID | Build script |
| --------- | ------------------------------- | ----------------- |
| `ios` | `com.expensify.expensifylite` | `npm run ios` |
| `android` | `org.me.mobiexpensifyg.dev` | `npm run android` |
### 3. Confirm dev build is installed
```bash
agent-device apps --user-installed --platform <p> --json
```
If the resolved bundle ID is missing from the list, **STOP** and instruct the developer to run the matching build script from the table. HybridApp mobile builds **must** be initiated from `Mobile-Expensify/` (per project CLAUDE.md).
### 4. Metro
```bash
agent-device metro prepare --public-base-url http://localhost:8081 --port 8081 --kind react-native
```
If `metro prepare` fails, **STOP** and surface the error verbatim.
### 5. Pick a target device
```bash
agent-device devices --platform <p> --json
```
- Prefer the first device with `booted=true`.
- If none are booted, choose the default target device (usually the first listed), then continue to step 6 to detect and clear any stale session bound to that device before opening.
- If multiple are booted, ask the user which.
Capture the device name and (for iOS) the simulator UDID, or (for Android) the serial.
### 6. Session reuse vs reset
```bash
agent-device session list --json
```
For each entry whose `device_udid` (iOS) or `serial` (Android) matches the chosen device:
- If the session was created earlier in the **current** Claude invocation, reuse it silently.
- Otherwise prompt: `reuse` (continue with the existing session) or `reset` (force-close it).
- To reset: `agent-device close --shutdown --session <name>`. `--shutdown` also frees the simulator.
### 7. Open
```bash
agent-device open <bundle-id> --platform <p> --device "<name>"
```
If `open` errors with "app not installed", revisit step 3.
### 8. Sanity
```bash
agent-device snapshot -i
```
Confirm the app rendered. From here, follow the [Agent decision loop](flows/README.md) for repeatable flows or drive interactively.
### Canonical skill references
Read these files directly for device automation guidance (bootstrap, exploration, verification, debugging): !`echo "$(npm root -g)/agent-device/skills/agent-device"`
## Flows
Repeatable steps (sign-in, onboarding, etc.) are captured as composable `.ad` snippets under [`flows/`](flows/README.md). For interactive usage, propose and run only `flows/macros/` helpers. `flows/tests/` belongs to a separate QA workflow and must not be proposed by this skill; QA/perf runs execute them via `agent-device test <path>`.
章节与文件索引
按说明文件中的顺序排列。
飞行前(自动)
培养
1. 平台
2. 捆绑包 ID
3.确认开发版本已安装
文件/命令 -> FAIL · agent-device · open · snapshot · replay · ios · android · com.expensify.expensifylite
内容校验值 -> 0ba3ce5ce654
当前原文的自动摘译,尚未人工审校。
飞行前(自动)
这些检查根据技能负荷进行评估。如果任何行显示
FAIL,请在运行任何设备命令之前停止并显示修复程序。agent-device版本:!R=0.13.0; V=$(agent-device --version 2>/dev/null); [ -n "$V" ] && [ "$(printf '%s\n%s\n' "$R" "$V" | sort -V | head -1)" = "$R" ] && echo "OK ($V)" || echo "FAIL (need v$R+, got: ${V:-not installed}). Fix: npm install -g agent-device@latest"捆绑的 CLI 技能目录:!D="$(npm root -g)/agent-device/skills/agent-device"; test -s "$D/SKILL.md" && echo "OK ($D)" || echo "FAIL (missing $D/SKILL.md). Fix: npm install -g agent-device@latest"培养
用户第一次在会话中请求设备交互时,在任何
open/snapshot/replay之前运行此序列。1. 平台
如果用户提示明确命名为
ios或android,请使用它。否则问。仅支持iOS和Android;拒绝其他平台。2. 捆绑包 ID
HybridApp dev 仅构建(飞行前门强制执行此操作)。平台 · 捆绑 ID · 构建脚本
ios·com.expensify.expensifylite·npm run iosandroid·org.me.mobiexpensifyg.dev·npm run android3.确认开发版本已安装
如果列表中缺少解析的包 ID,请停止并指示开发人员运行表中匹配的构建脚本。 HybridApp 移动构建必须从
Mobile-Expensify/启动(根据项目 CLAUDE.md)。