android-adb
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAndroid ADB Automation
Android ADB 自动化
Execute Android operations with in the skill directory.
scripts/adb_helpers.tsandroid-adb在 skill目录中,通过执行Android操作。
android-adbscripts/adb_helpers.tsPath Convention
路径规范
Canonical install and execution directory: . Run commands from this directory:
~/.agents/skills/android-adb/bash
cd ~/.agents/skills/android-adbOne-off (safe in scripts/loops from any working directory):
bash
(cd ~/.agents/skills/android-adb && npx tsx scripts/adb_helpers.ts --help)标准安装与执行目录:。请在此目录下运行命令:
~/.agents/skills/android-adb/bash
cd ~/.agents/skills/android-adb一次性执行(可在任意工作目录的脚本/循环中安全使用):
bash
(cd ~/.agents/skills/android-adb && npx tsx scripts/adb_helpers.ts --help)Core Capabilities
核心功能
- Device discovery and connection management.
- App lifecycle control (,
launch).force-stop - Input primitives (,
tap,swipe,long-press,keyevent).text - Screenshot and UI dump utilities (,
screenshot).dump-ui --parse - Install automation with UI assistance ().
install-smart - Device reset workflow for app ().
device-reset
- 设备发现与连接管理
- 应用生命周期控制(、
launch)force-stop - 输入原语操作(、
tap、swipe、long-press、keyevent)text - 截图与UI导出工具(、
screenshot)dump-ui --parse - 带UI辅助的安装自动化()
install-smart - 应用专属设备重置流程()
device-reset
Execution Constraints
执行约束
- Use whenever more than one device is connected.
-s <device_id> - Confirm resolution before coordinate actions: .
npx tsx scripts/adb_helpers.ts -s SERIAL wm-size - Run each command in its owning skill directory (
npxorandroid-adb).ai-vision - Prefer helper subcommands before raw calls.
adb - Prefer when ADB Keyboard exists; otherwise use plain
text --adb-keyboard.text - Ask for missing required inputs before executing (serial, package/activity/schema, coordinates, APK path).
- Surface actionable stderr on failure (authorization, cable/network, tcpip state, missing env vars).
- 当连接多台设备时,务必使用指定设备
-s <device_id> - 在执行坐标类操作前,请确认分辨率:
npx tsx scripts/adb_helpers.ts -s SERIAL wm-size - 需在对应skill目录(或
android-adb)中运行每个ai-vision命令npx - 优先使用辅助子命令,而非直接调用原生
adb - 若已安装ADB Keyboard,优先使用;否则使用普通
text --adb-keyboard命令text - 执行前需确认所有必填输入项(设备序列号、包名/活动名/架构、坐标、APK路径)是否齐全
- 执行失败时需展示可操作的标准错误信息(权限问题、线缆/网络问题、tcpip状态、缺失环境变量)
Reference Map
参考文档
- Command catalog and examples:
references/adb-reference.md - Vision-first UI recognition flow:
references/ui-recognition.md - Installer dialog handling details:
references/install-smart.md - Generic verification handling:
references/handle-verification.md - Device reset flow for app:
references/device-reset.md
Load only the file needed for the current task.
- 命令目录与示例:
references/adb-reference.md - 视觉优先的UI识别流程:
references/ui-recognition.md - 安装器弹窗处理细节:
references/install-smart.md - 通用验证处理:
references/handle-verification.md - 应用专属设备重置流程:
references/device-reset.md
仅加载当前任务所需的文档即可。
Minimal Commands
基础命令示例
bash
npx tsx scripts/adb_helpers.ts --help
npx tsx scripts/adb_helpers.ts devices
npx tsx scripts/adb_helpers.ts -s SERIAL wm-size
npx tsx scripts/adb_helpers.ts -s SERIAL screenshot --out ~/.eval/screenshots/shot.pngbash
npx tsx scripts/adb_helpers.ts --help
npx tsx scripts/adb_helpers.ts devices
npx tsx scripts/adb_helpers.ts -s SERIAL wm-size
npx tsx scripts/adb_helpers.ts -s SERIAL screenshot --out ~/.eval/screenshots/shot.png