android_ui_verification
它能做什么
这个工具可以帮你在 Android 手机上测试应用。它会模拟点击、输入文字并截图,检查一切是否按预期工作。
适用场景
- ✓验证应用中的视觉改动是否生效时。
- ✓自动发现布局或交互方面的问题时。
- ✓无需手动测试,就能确认新功能是否正常工作时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/android_ui_verification/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“检查“登录”按钮是否显示,并确认我能不能点击它。”
每周 5 个新技能,1 分钟读完。
工作原理
这个工具会使用特定的命令与手机“通信”。它会先找到屏幕上按钮和文字的位置,然后模拟你的点击和输入。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Android UI Verification Skill
This skill provides a systematic approach to testing React Native applications on an Android emulator using ADB commands. It allows for autonomous interaction, state verification, and visual regression checking.
When to Use
- Verifying UI changes in React Native or Native Android apps.
- Autonomous debugging of layout issues or interaction bugs.
- Ensuring feature functionality when manual testing is too slow.
- Capturing automated screenshots for PR documentation.
🛠 Prerequisites
- Android Emulator running.
adbinstalled and in PATH.- Application in debug mode for logcat access.
🚀 Workflow
1. Device Calibration
Before interacting, always verify the screen resolution to ensure tap coordinates are accurate.
adb shell wm size
Note: Layouts are often scaled. Use the physical size returned as the base for coordinate calculations.
2. UI Inspection (State Discovery)
Use the uiautomator dump to find the exact bounds of UI elements (buttons, inputs).
adb shell uiautomator dump /sdcard/view.xml && adb pull /sdcard/view.xml ./artifacts/view.xml
Search the view.xml for text, content-desc, or resource-id. The bounds attribute [x1,y1][x2,y2] defines the clickable area.
3. Interaction Commands
- Tap:
adb shell input tap <x> <y>(Use the center of the element bounds). - Swipe:
adb shell input swipe <x1> <y1> <x2> <y2> <duration_ms>(Used for scrolling). - Text Input:
adb shell input text "<message>"(Note: Limited support for special characters). - Key Events:
adb shell input keyevent <code_id>(e.g., 66 for Enter).
4. Verification & Reporting
Visual Verification
Capture a screenshot after interaction to confirm UI changes.
adb shell screencap -p /sdcard/screen.png && adb pull /sdcard/screen.png ./artifacts/test_result.png
Analytical Verification
Monitor the JS console logs in real-time to detect errors or log successes.
adb logcat -d | grep "ReactNativeJS" | tail -n 20
Cleanup
Always store generated files in the artifacts/ folder to satisfy project organization rules.
💡 Best Practices
- Wait for Animations: Always add a short sleep (e.g., 1-2s) between interaction and verification.
- Center Taps: Calculate the arithmetic mean of
[x1,y1][x2,y2]for the most reliable tap target. - Log Markers: Use distinct log messages in the code (e.g.,
✅ Action Successful) to makegrepverification easy. - Fail Fast: If a
uiautomator dumpfails or doesn't find the expected text, stop and troubleshoot rather than blind-tapping.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
常见问题
使用它需要准备什么特别的东西吗?
需要。你得先在电脑上运行一个 Android 模拟器(也就是电脑上的虚拟手机),并安装好 `adb` 程序。
它是怎么知道该点哪里的?
它会对屏幕截一张“图”,分析每个按钮和文字所在的位置,再计算出准确的点击位置。
它能测试任何应用吗?
用 React Native 或原生 Android 开发的应用效果最好,而且应用需要处于调试模式,才能看到日志。
详情
作者的原始描述
Automated end-to-end UI testing and verification on an Android Emulator using ADB.
热度
- GitHub 星标
- 48k
- 排名
- #3744
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。