argent-android-emulator-setup
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese1. Prerequisites
1. 前提条件
- Android SDK Platform Tools on PATH — provides .
adb - Android Emulator on PATH — needed to boot AVDs. If you will only use an already-running emulator or a physical device, adb alone is sufficient.
- An AVD created via Android Studio or .
avdmanager create avd
Verify with and .
adb versionemulator -list-avds- Android SDK Platform Tools已添加至PATH —— 提供工具。
adb - Android Emulator已添加至PATH —— 用于启动AVD。如果仅使用已运行的模拟器或物理设备,仅需adb即可。
- 已通过Android Studio或创建AVD。
avdmanager create avd
通过和命令验证。
adb versionemulator -list-avds2. Setup
2. 设置步骤
- Find a ready device — call . Filter for entries with
list-devices. Ready devices (platform: "android") come first. Pick the firststate: "device"(e.g.serial) unless the user specified one.emulator-5554 - Boot if needed — if nothing Android is ready, call with
boot-devicefrom the same call'savdName: <name>list. The tool transparently picks hot vs cold boot: it probes the AVD'savdssnapshot, restores it under a tight deadline when usable, and falls back to a full cold boot otherwise. Hot path is typically ~30s; cold path takes 2–10 min. On any stage failure the tool kills the emulator process it started so your next call starts from a clean state.default_boot - Metro (for React Native) — once a device is up, run so the device can reach Metro on your host. Repeat if the device restarts. See the
adb -s <serial> reverse tcp:8081 tcp:8081skill.argent-metro-debugger
- 查找可用设备 —— 调用命令。筛选出
list-devices的条目。可用设备(platform: "android")会排在前面。除非用户指定,否则选择第一个state: "device"(例如serial)。emulator-5554 - 按需启动模拟器 —— 如果没有可用的Android设备,使用同一调用返回的列表中的
avds调用avdName: <name>命令。该工具会自动选择热启动或冷启动:它会检测AVD的boot-device快照,若在限定时间内可用则恢复快照,否则回退到完整冷启动。热启动通常约30秒;冷启动需2–10分钟。任何阶段失败时,工具会终止其启动的模拟器进程,确保下次调用从干净状态开始。default_boot - Metro(适用于React Native) —— 设备启动后,运行,使设备能够访问主机上的Metro。设备重启后需重复此操作。详情请查看
adb -s <serial> reverse tcp:8081 tcp:8081技能。argent-metro-debugger
3. Using the device
3. 使用设备
Pass the Android serial as to the unified interaction tools — , , , , , , etc. Dispatch is automatic based on the id shape. See for platform-neutral interaction tooling and the Android-specific gotchas section at the bottom of that skill.
udidgesture-tapgesture-swipedescribescreenshotlaunch-appkeyboardargent-device-interact将Android序列号作为传递给统一交互工具——、、、、、等。工具会根据ID格式自动分发任务。有关跨平台交互工具及Android特定注意事项,请查看技能底部的相关部分。
udidgesture-tapgesture-swipedescribescreenshotlaunch-appkeyboardargent-device-interact4. Notes
4. 注意事项
- Serials are the adb device id. iOS UDIDs and Android serials are not interchangeable, but you do NOT need to tell the tools which platform — dispatch is automatic.
- on Android returns a shallower tree than iOS (no accessibility-service equivalent), but covers most tap-target discovery.
describe - on Android always installs with
reinstall-appso first-launch runtime permissions are pre-granted.-g - To kill the emulator when you're done, run from a shell.
adb -s <serial> emu kill
- 序列号即adb设备ID。iOS UDID与Android序列号不可互换,但无需告知工具平台类型——工具会自动分发任务。
- Android上的命令返回的树结构比iOS更浅(无等价的辅助功能服务),但可覆盖大多数点击目标的发现需求。
describe - Android上的命令始终使用
reinstall-app参数安装,因此首次启动时会预先授予运行时权限。-g - 使用完毕后,可从shell运行命令终止模拟器。
adb -s <serial> emu kill