Agent Skills › software-mansion/argent › argent-android-emulator-setup

argent-android-emulator-setup

GitHub

用于在 Android 模拟器或真机上完成环境配置、设备连接及 UI 自动化交互的 Skill。涵盖启动 AVD、ADB 调试及手势操作等场景。

packages/skills/skills/argent-android-emulator-setup/SKILL.md software-mansion/argent

Trigger Scenarios

启动新的 Android 会话 引导 Android 模拟器 获取设备序列号 执行 UI 自动化交互前

Install

npx skills add software-mansion/argent --skill argent-android-emulator-setup -g -y
More Options

Non-standard path

npx skills add https://github.com/software-mansion/argent/tree/main/packages/skills/skills/argent-android-emulator-setup -g -y

Use without installing

npx skills use software-mansion/argent@argent-android-emulator-setup

指定 Agent (Claude Code)

npx skills add software-mansion/argent --skill argent-android-emulator-setup -a claude-code -g -y

安装 repo 全部 skill

npx skills add software-mansion/argent --all -g -y

预览 repo 内 skill

npx skills add software-mansion/argent --list

SKILL.md

Frontmatter
{
    "name": "argent-android-emulator-setup",
    "description": "Set up and connect to an Android emulator using argent MCP tools. Use when starting a new session on Android, booting an emulator, getting a device serial, or before any UI interaction task."
}

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.

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

  • Android TV / leanback AVDs boot through this exact flow (same boot-device + avdName), but they are focus-driven, not touch-driven; do not use gesture-tap/gesture-swipe on them. list-devices tags a leanback device with runtimeKind: "tv" (detected via the system feature list, not the serial: a TV AVD's serial looks just like a phone's). When you see runtimeKind: "tv", drive it with the focus-driven tools (describe / tv-remote / keyboard) and the argent-tv-interact skill (it covers Android TV as well as Apple TV, including the full TV setup flow).
  • 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.

Version History

  • f0e04a6 Current 2026-10-19 02:08

    将工具描述和规则中的 em dash 替换为标点符号,统一文本格式。

  • 3c1f2ae 2026-09-22 07:44

    优化指令描述,简化并整合了与metro-debugger相关的说明,消除冗余。

  • bc04c3b 2026-07-06 19:58

Same Skill Collection

packages/skills/skills/argent-create-flow/SKILL.md
packages/skills/skills/argent-device-interact/SKILL.md
packages/skills/skills/argent-ios-device-interact/SKILL.md
packages/skills/skills/argent-ios-device-setup/SKILL.md
packages/skills/skills/argent-ios-simulator-setup/SKILL.md
packages/skills/skills/argent-lens/SKILL.md
packages/skills/skills/argent-metro-debugger/SKILL.md
packages/skills/skills/argent-native-profiler/SKILL.md
packages/skills/skills/argent-react-native-app-workflow/SKILL.md
packages/skills/skills/argent-react-native-optimization/SKILL.md
packages/skills/skills/argent-react-native-profiler/SKILL.md
packages/skills/skills/argent-screen-recording/SKILL.md
packages/skills/skills/argent-screenshot-diff/SKILL.md
packages/skills/skills/argent-test-ui-flow/SKILL.md
packages/skills/skills/argent-tv-interact/SKILL.md
packages/skills/skills/argent-qa-flows/SKILL.md
packages/skills/skills/argent-settings-permissions/SKILL.md

Metadata

Files
0
Version
f0e04a6
Hash
a60789d1
Indexed
2026-07-06 19:58

홈 - 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-21 00:43
浙ICP备14020137号-1