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.

16 stars

Best use case

adb-device-testing is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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.

Teams using adb-device-testing should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/adb-device-testing/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/cli-automation/adb-device-testing/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/adb-device-testing/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How adb-device-testing Compares

Feature / Agentadb-device-testingStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# ADB Device Testing

## Quick Reference

### Screenshots (Multimodal)
```bash
adb exec-out screencap -p > /tmp/screen.png
```
Then use Read tool to VIEW the image.

### Location Spoofing (Emulator Only)
```bash
# 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 | `adb shell input tap <x> <y>` |
| Scroll up | `adb shell input swipe 500 1500 500 500 300` |
| Scroll down | `adb shell input swipe 500 500 500 1500 300` |
| Back | `adb shell input keyevent KEYCODE_BACK` |
| Home | `adb shell input keyevent KEYCODE_HOME` |
| Text | `adb shell input text "hello"` |
| Long press | `adb shell input swipe 500 500 500 500 1000` |

### Element Discovery (uiautomator)
```bash
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
```bash
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**
```bash
adb devices -l
```
No devices? Check USB debugging enabled, emulator running.

**2. Setup**
```bash
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**
```bash
# 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**
```bash
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

1. **Always wait** after UI actions before screenshots (`sleep 0.5-1`)
2. **View screenshots** with Read tool - don't just capture
3. **Use absolute paths** for screenshot files
4. **Location spoofing = emulator only** - physical devices need mock apps
5. **Parse uiautomator XML** for precise element coordinates

## Advanced Features

**Device info:**
```bash
adb shell wm size              # resolution
adb shell getprop ro.product.model
```

**Logs:**
```bash
adb logcat -d | grep <package>
```

**Screen recording:**
```bash
adb shell screenrecord /sdcard/demo.mp4
# Ctrl+C to stop
adb pull /sdcard/demo.mp4 /tmp/
```

**For complex testing scenarios**: See [ADVANCED.md](ADVANCED.md)

Related Skills

ai-powered-pentesting

16
from diegosouzapw/awesome-omni-skill

Guide for AI-powered penetration testing tools, red teaming frameworks, and autonomous security agents.

ab-testing-analyzer

16
from diegosouzapw/awesome-omni-skill

全面的AB测试分析工具,支持实验设计、统计检验、用户分群分析和可视化报告生成。用于分析产品改版、营销活动、功能优化等AB测试结果,提供统计显著性检验和深度洞察。

cli-e2e-testing

16
from diegosouzapw/awesome-omni-skill

CLI E2E testing patterns with BATS - parallelization, state sharing, and timeout management

bats-testing-patterns

16
from diegosouzapw/awesome-omni-skill

Comprehensive guide for writing shell script tests using Bats (Bash Automated Testing System). Use when writing or improving tests for Bash/shell scripts, creating test fixtures, mocking commands, or setting up CI/CD for shell script testing. Includes patterns for assertions, setup/teardown, mocking, fixtures, and integration with GitHub Actions.

sqlmap-database-pentesting

16
from diegosouzapw/awesome-omni-skill

This skill should be used when the user asks to "automate SQL injection testing," "enumerate database structure," "extract database credentials using sqlmap," "dump tables and columns...

sql-injection-testing

16
from diegosouzapw/awesome-omni-skill

This skill should be used when the user asks to "test for SQL injection vulnerabilities", "perform SQLi attacks", "bypass authentication using SQL injection", "extract database inform...

Contract Testing Pact

16
from diegosouzapw/awesome-omni-skill

Contract testing validates that service consumers and providers agree on request/response expectations. Pact implements consumer-driven contracts (CDC) with shareable pact files and provider verificat

Async Testing Expert

16
from diegosouzapw/awesome-omni-skill

Comprehensive pytest skill for async Python testing with proper mocking, fixtures, and patterns from production-ready test suites. Use when writing or improving async tests for Python applications, especially FastAPI backends with database interactions.

api-testing

16
from diegosouzapw/awesome-omni-skill

Test FastAPI endpoints with pytest and generate API documentation. Use when creating new APIs or verifying existing endpoints work correctly.

api-testing-suite

16
from diegosouzapw/awesome-omni-skill

Validate API responses and schemas.

api-testing-patterns

16
from diegosouzapw/awesome-omni-skill

Comprehensive API testing patterns including contract testing, REST/GraphQL testing, and integration testing. Use when testing APIs or designing API test strategies.

api-testing-observability-api-mock

16
from diegosouzapw/awesome-omni-skill

You are an API mocking expert specializing in realistic mock services for development, testing, and demos. Design mocks that simulate real API behavior and enable parallel development.