Claude-skill-registry android-adb
Automate ADB commands for device management, app installation, and log analysis. Use when listing devices, installing APKs, viewing logs, debugging app issues, or capturing screenshots.
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/android-adb" ~/.claude/skills/majiayu000-claude-skill-registry-android-adb && rm -rf "$T"
manifest:
skills/data/android-adb/SKILL.mdsource content
Android ADB Skill
Automate ADB commands for device management, app installation, and log analysis.
When to Use
- Listing connected devices
- Installing/uninstalling APKs
- Viewing application logs
- Debugging app issues
- Capturing screenshots/screen recordings
Commands
Device Management
| Command | Description | ADB Command |
|---|---|---|
| List connected devices | |
| Restart ADB server | |
App Management
| Command | Description | ADB Command |
|---|---|---|
| Install APK | |
| Remove app | |
| Clear app data | |
| Launch app | |
| Force stop app | |
Logcat Commands
| Command | Description | ADB Command |
|---|---|---|
| View all logs | |
| App logs only | |
| Filter by tag | |
| Errors only | |
| Clear log buffer | |
Debug Commands
| Command | Description | ADB Command |
|---|---|---|
| Capture screen | |
| Record screen | |
| Check ANR traces | |
| Get crash logs | |
Logcat Patterns
# Filter by specific tags (common managers) adb logcat -s GameManagerImpl AuthService SyncManager # Compose errors adb logcat | grep -i "compose\|recomposition" # Coroutine exceptions adb logcat | grep "CoroutineException\|JobCancellationException" # ANR detection adb logcat | grep -i "ANR\|Application Not Responding" # Timber logs (class name as tag) adb logcat | grep -E "(GameManager|UserManager|AuthService)"
Usage Examples
# Install and launch debug build adb install -r app/build/outputs/apk/debug/app-debug.apk adb shell am start -n com.creative.aiquiz/.LauncherActivity # Clear app data and restart adb shell pm clear com.creative.aiquiz adb shell am start -n com.creative.aiquiz/.LauncherActivity # Monitor specific logs adb logcat -s GameManagerImpl:V # Capture crash on error adb logcat *:E -d > crash_log.txt # Take screenshot for bug report adb exec-out screencap -p > screenshot.png
Error Handling
# Check device connection adb devices -l || (adb kill-server && adb start-server && adb devices -l) # Handle installation errors adb install -r app.apk 2>&1 | grep -q "INSTALL_FAILED" && { echo "Installation failed - checking signature..." adb uninstall com.package.name adb install app.apk } # Parse crash from logcat adb logcat -b crash -d | grep -A 20 "FATAL EXCEPTION"
Common Errors:
- Device not found: Enable USB debugging in Developer Options
- Installation failed: Uninstall conflicting version first
- Permission denied: Device needs root or debugging enabled
- Unauthorized: Approve computer on device prompt
Troubleshooting
| Issue | Command |
|---|---|
| Device offline | |
| Multiple devices | |
| App not starting | |
| Screen frozen | |
| Storage full | |
Command Workflows
# Full debug cycle adb logcat -c && \ ./gradlew installDebug && \ adb shell am start -n com.pkg/.MainActivity && \ adb logcat -s MainActivity:V # Capture crash report adb logcat -b crash -d > crash.txt && \ adb bugreport > bugreport.zip # Monitor specific feature adb logcat -c && adb logcat -s GameManager AuthService SyncManager
CI/CD Integration
# Firebase Test Lab - name: Run Instrumented Tests run: | gcloud firebase test android run \ --type instrumentation \ --app app-debug.apk \ --test app-debug-androidTest.apk
Best Practices
- Prefer filtered logs to avoid overwhelming output
- Use
flag to dump existing logs and exit-d - Clear logcat before reproducing issues
- Use Timber tags consistently (class name)