首页/移动开发/argent-android-emulator-setup
A

argent-android-emulator-setup

by @software-mansionv
4.6(120)

此技能用于自动化 Android 模拟器的设置与连接,包括设备发现、启动和 Metro 配置。它为移动应用开发和测试提供了一个即用型环境,显著减少了手动设置时间并确保了测试条件的一致性。

androidemulatormobile-developmentautomationtestingGitHub
安装方式
npx skills add https://github.com/software-mansion/argent --skill argent-android-emulator-setup
compare_arrows

Before / After 效果对比

1 组
使用前

在没有这个技能之前,用户需要手动检查 ADB 设备、启动 AVD、等待模拟器启动并手动配置 Metro,整个过程耗时且易出错,尤其是在处理冷启动或多个模拟器时。

使用后

该 Skill 能够自动发现或启动 Android 模拟器,并完成 Metro 配置,为用户提供一个即用型环境,显著减少了手动操作和等待时间,确保了开发和测试的效率。

SKILL.md

1. Prerequisites

  • 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 adb version and emulator -list-avds.

2. Setup

  1. Find a ready device — call list-devices. Filter for entries with platform: "android". Ready devices (state: "device") come first. Pick the first serial (e.g. emulator-5554) unless the user specified one.
  2. Boot if needed — if nothing Android is ready, call boot-device with avdName: <name> from the same call's avds list. The tool transparently picks hot vs cold boot: it probes the AVD's default_boot snapshot, 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.
  3. Metro (for React Native) — once a device is up, run adb -s <serial> reverse tcp:8081 tcp:8081 so the device can reach Metro on your host. Repeat if the device restarts. See the argent-metro-debugger skill.

3. Using the device

Pass the Android serial as udid to the unified interaction tools — gesture-tap, gesture-swipe, describe, screenshot, launch-app, keyboard, etc. Dispatch is automatic based on the id shape. See argent-device-interact for platform-neutral interaction tooling and the Android-specific gotchas section at the bottom of that skill.

4. Notes

  • 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.
  • describe on Android returns a shallower tree than iOS (no accessibility-service equivalent), but covers most tap-target discovery.
  • reinstall-app on Android always installs with -g so first-launch runtime permissions are pre-granted.
  • To stop the emulator, run adb -s <serial> emu kill from a shell (clean shutdown). Never pkill -9/kill -9 qemu — a hard kill leaves the userdata image dirty, after which cold boots can hang for many minutes doing recovery (runaway writes, boot_completed never flips). If an image gets into that state, boot once with -wipe-data to reset it.

用户评价 (0)

发表评价

效果
易用性
文档
兼容性

暂无评价

统计数据

安装量25.9K
评分4.6 / 5.0
版本
更新日期2026年10月23日
对比案例1 组

用户评分

4.6(120)
5
37%
4
43%
3
13%
2
5%
1
2%

为此 Skill 评分

0.0

兼容平台

🤖claude-code

时间线

创建2026年6月9日
最后更新2026年10月23日
🎁 Agent 知识卡片
调研问卷