android-emulator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Android Emulator

Android模拟器

Use
agent-device
on an Android Emulator to verify a running app. Work from the live UI, act on current refs or selectors, and verify the result before closing the session.
For an app or package id, open it in the foreground:
bash
agent-device open <app-or-package-id> --platform android --foreground
open
returns the initial interactive snapshot. Use its current refs or a selector. For a planned action, use
--settle
. If the settled diff shows the next target, continue from it:
bash
agent-device press @eN --settle
agent-device fill @eN "text" --settle
Run
agent-device snapshot -i
only when the settled diff does not show the next target.
type
never takes
--settle
; verify it with a snapshot or named
wait
. Keep state-changing commands serial. Verify the end state with a selector or exact text, then close:
bash
agent-device close
For non-routine work, use the version-matched CLI help:
bash
agent-device help validate
Read only the relevant follow-up topic for specialized work:
bash
agent-device help debugging       # screenshots, logs, traces, video, and failures
agent-device help react-native    # React Native and Expo runtime guidance
agent-device help react-devtools  # component tree, props/state/hooks, and renders
agent-device help scripting       # durable replay and CI workflows
Use
adb shell
only for platform operations. Use this workflow to verify the app and keep diagnostic output when it fails.
使用
agent-device
在Android模拟器上验证运行中的应用。基于实时UI操作,针对当前引用或选择器执行操作,并在关闭会话前验证结果。
对于应用或包ID,将其在前台打开:
bash
agent-device open <app-or-package-id> --platform android --foreground
open
命令会返回初始交互式快照。使用其当前引用或选择器。若要执行计划操作,使用
--settle
参数。如果稳定后的差异显示了下一个目标,则基于该目标继续操作:
bash
agent-device press @eN --settle
agent-device fill @eN "text" --settle
仅当稳定后的差异未显示下一个目标时,才运行
agent-device snapshot -i
type
命令从不使用
--settle
参数;需通过快照或命名
wait
来验证。保持状态变更命令串行执行。使用选择器或精确文本验证最终状态,然后关闭会话:
bash
agent-device close
对于非常规工作,请使用版本匹配的CLI帮助:
bash
agent-device help validate
仅阅读相关后续主题以完成专业工作:
bash
agent-device help debugging       # 截图、日志、追踪、视频及故障排查
agent-device help react-native    # React Native和Expo运行时指南
agent-device help react-devtools  # 组件树、属性/状态/钩子及渲染
agent-device help scripting       # 持久化重放与CI工作流
仅将
adb shell
用于平台操作。使用此工作流验证应用,并在应用故障时保留诊断输出。