SuperAPI AI 工具集

adb-device-testing

测试与质量

查看项目

更新于 10-15 21:09

技能介绍

用途:在通过 ADB 连接的 Android 设备或模拟器上测试应用,完成 UI 自动化、截图取证、位置模拟、导航操作与应用管理。

主要能力:截图(adb exec-out screencap -p > /tmp/screen.png,再用 Read 工具查看图像);位置模拟(仅模拟器,adb emu geo fix <经度> <纬度>);导航操作(点击 adb shell input tap <x> <y>、滑动 adb shell input swipe、返回 KEYCODE_BACK、主页 KEYCODE_HOME、输入文本 adb shell input text "hello"、长按);元素发现(adb shell uiautomator dump /sdcard/ui.xml 后 adb pull,解析 bounds="[x1,y1][x2,y2]" 取中心点);应用管理(adb install -r app.apk、am start、am force-stop、pm clear);设备信息、日志与录屏。

使用方式:先 adb devices -l 确认连接;安装应用、清除状态、设置位置并启动;每步操作后等待 0.5–1 秒再截图验证;用 uiautomator 获取精确坐标;最后带证据报告结果。

限制:位置模拟仅适用于模拟器,真机需借助 mock 应用;截图文件建议使用绝对路径;复杂场景参见 ADVANCED.md。具体收费、平台支持范围等资料暂未提供。