adb-bot
Use when connecting Android devices, controlling app lifecycle, filtering logs, taking screenshots, pulling files, or checking performance metrics via adb
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when connecting Android devices, controlling app lifecycle, filtering logs, taking screenshots, pulling files, or checking performance metrics via adb
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when running PoLang automated tests via JSON commands sent through AgentTestBroadcastReceiver, including test suites, single test cases, camera/agent feature verification, or performance/log collection
Use when running the full PoLang development self-heal loop from code check through install, device verification, and report generation
Use when performing PoLang QA acceptance, including end-to-end verification, boundary testing, performance baseline comparison, and red-line compliance checks
Use when automating PoLang UI interactions through structured accessibility data, replacing screenshot-based image recognition with precise text, contentDescription, or bounds-driven actions
| name | adb-bot |
| description | Use when connecting Android devices, controlling app lifecycle, filtering logs, taking screenshots, pulling files, or checking performance metrics via adb |
定位:通用 Android adb 调试与设备控制。 触发时机:需要连接设备、启动/停止应用、收集日志、截屏、查看性能指标等基础 adb 操作时启用。 PoLang 专属命令:使用 agent-test(Agent Test)。 UI 自动化:使用 ui-driver(UI Driver)。
# 检查设备
adb devices
# 启动 PoLang
adb shell am start -n com.mamba.picme/.MainActivity
# 强制停止
adb shell am force-stop com.mamba.picme
# 过滤 PoLang 日志
adb logcat -s PoLang:* *:S
# 截屏(仅用于最终视觉验证,UI 状态优先用 accessibility dump)
adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png /tmp/screen.png
adb devices # 列出已连接设备
adb -s <serial> shell ... # 指定设备执行命令
adb kill-server && adb start-server # 重启 adb 服务
adb shell pidof com.mamba.picme # 检查应用是否运行
adb shell am start -n com.mamba.picme/.MainActivity # 启动应用
adb shell am force-stop com.mamba.picme # 强制停止
adb shell pm clear com.mamba.picme # 清除应用数据
# 实时过滤 PoLang 标签
adb logcat -s PoLang:* *:S
# 清除后重新捕获
adb logcat -c
adb shell am start -n com.mamba.picme/.MainActivity
adb logcat -s PoLang:*
# 导出到文件并搜索异常
adb logcat -d > /tmp/logcat.txt
grep -iE "error|exception|fatal|failed" /tmp/logcat.txt
优先使用 ui-driver,以下命令仅在无法启用 AccessibilityService 时使用。
# 点击坐标
adb shell input tap 500 1500
# 滑动
adb shell input swipe 300 1000 300 500
# 按键
adb shell input keyevent KEYCODE_BACK
adb shell input keyevent KEYCODE_CAMERA
adb shell input keyevent KEYCODE_VOLUME_UP
# 截屏
adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png /tmp/screen.png
# 录屏(默认 180 秒)
adb shell screenrecord /sdcard/video.mp4
adb pull /sdcard/video.mp4 /tmp/video.mp4
# 拉取 SharedPreferences
adb shell run-as com.mamba.picme cat /data/data/com.mamba.picme/shared_prefs/*.xml
# 拉取数据库
adb shell run-as com.mamba.picme cat /data/data/com.mamba.picme/databases/*.db > /tmp/app.db
# 推送测试资源
adb push test_image.jpg /sdcard/Pictures/
adb shell am broadcast -a android.intent.action.MEDIA_SCANNER_SCAN_FILE -d file:///sdcard/Pictures/test_image.jpg
# 拉取 accessibility UI dump(备用)
adb shell uiautomator dump /sdcard/window_dump.xml
adb pull /sdcard/window_dump.xml
# FPS / 帧渲染
adb shell dumpsys gfxinfo com.mamba.picme | grep -iE "jank|frame|percentile"
# 内存
adb shell dumpsys meminfo com.mamba.picme
# CPU
adb shell top -p $(adb shell pidof com.mamba.picme) -n 1
# 当前顶部 Activity
adb shell dumpsys activity top | grep -i "ACTIVITY"
# 窗口信息
adb shell dumpsys window displays
| 症状 | 检查/修复 |
|---|---|
| 设备未识别 | adb devices;重新插拔 USB;adb kill-server && adb start-server |
| 日志无输出 | 确认 PID 正确;先用 adb logcat -d 全量查看 |
| 截屏失败 | 检查设备连接和 /sdcard/ 可写性 |
| 文件 run-as 失败 | 应用必须是 debug 包;或先 adb shell 再 su |
| 版本 | 日期 | 变更 |
|---|---|---|
| 2.0.0 | 2026-07-02 | 统一标题为 ADB Bot;移除 PoLang 专属 TEST_COMMAND 内容,改为通用 adb 参考;指向 Agent Test 和 UI Driver |
| 1.1.0 | 2026-05-31 | 统一格式,添加定位块 |
| 1.0.0 | 2026-05-03 | 初始版本 |