Claude-skill-registry adb-device-testing
Use when testing Android apps on ADB-connected devices/emulators - UI automation, screenshots, location spoofing, navigation, app management. Triggers on ADB, emulator, Android testing, location mock, UI test, screenshot walkthrough.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/adb-device-testing" ~/.claude/skills/majiayu000-claude-skill-registry-adb-device-testing && rm -rf "$T"
manifest:
skills/data/adb-device-testing/SKILL.mdsource content
ADB Device Testing
Quick Reference
Screenshots (Multimodal)
adb exec-out screencap -p > /tmp/screen.png
Then use Read tool to VIEW the image.
Location Spoofing (Emulator Only)
# longitude, latitude adb emu geo fix -74.006 40.7128 # NYC adb emu geo fix 2.3522 48.8566 # Paris
IMPORTANT: for getting proper component location always use Element Discovery (uiautomator)
Navigation
| Action | Command |
|---|---|
| Tap | |
| Scroll up | |
| Scroll down | |
| Back | |
| Home | |
| Text | |
| Long press | |
Element Discovery (uiautomator)
adb shell uiautomator dump /sdcard/ui.xml adb pull /sdcard/ui.xml /tmp/ui.xml # Parse bounds="[x1,y1][x2,y2]" → tap center
App Management
adb install -r app.apk adb shell am start -n <package>/<activity> adb shell am force-stop <package> adb shell pm clear <package>
Testing Workflow
Copy this checklist:
Progress: - [ ] Verify device connected (adb devices) - [ ] Setup: install app, clear state, set location - [ ] Screenshot initial state - [ ] Execute test actions (tap/swipe) - [ ] Wait after each action (sleep 0.5-1) - [ ] Screenshot and verify each step - [ ] Report results with evidence
Step-by-Step
1. Verify Connection
adb devices -l
No devices? Check USB debugging enabled, emulator running.
2. Setup
adb install -r /path/to/app.apk adb shell pm clear <package> adb emu geo fix <lon> <lat> # emulator only adb shell am start -n <package>/<activity> sleep 2
3. Test Loop
# Screenshot adb exec-out screencap -p > /tmp/screen_01.png # View screenshot with Read tool to analyze UI # Identify tap coordinates from UI or uiautomator dump adb shell input tap <x> <y> sleep 1 # Screenshot to verify adb exec-out screencap -p > /tmp/screen_02.png
4. Element Finding
adb shell uiautomator dump /sdcard/ui.xml adb pull /sdcard/ui.xml /tmp/ui.xml # Grep for element: bounds="[100,200][300,400]" # Tap center: (100+300)/2=200, (200+400)/2=300 adb shell input tap 200 300
Critical Rules
- Always wait after UI actions before screenshots (
)sleep 0.5-1 - View screenshots with Read tool - don't just capture
- Use absolute paths for screenshot files
- Location spoofing = emulator only - physical devices need mock apps
- Parse uiautomator XML for precise element coordinates
Advanced Features
Device info:
adb shell wm size # resolution adb shell getprop ro.product.model
Logs:
adb logcat -d | grep <package>
Screen recording:
adb shell screenrecord /sdcard/demo.mp4 # Ctrl+C to stop adb pull /sdcard/demo.mp4 /tmp/
For complex testing scenarios: See ADVANCED.md