Loading...
Loading...
Use when working with Android devices via ADB - connecting devices, running shell commands, installing apps, debugging, taking screenshots, UI automation, viewing logs, analyzing crashes, or exploring system internals. Triggers on "adb", "logcat", "install apk", "debug android", "android device", "shell command", "screenshot", "dumpsys", "crash", "ANR".
npx skill4agent add hyperb1iss/hyperdroid-skill androidadb devices -ldeviceunauthorizedofflineadb kill-server && adb start-serveradb pair <ip>:<pairing_port>adb connect <ip>:<connection_port>adb tcpip 5555
adb connect <device_ip>:5555-sadb -s <serial> shell
adb -s emulator-5554 install app.apkadb shell # Enter shell
adb shell <command> # Run single command
adb shell "cmd1 && cmd2" # Chain commands# Device info
getprop ro.product.model # Device model
getprop ro.build.version.release # Android version
getprop ro.build.version.sdk # SDK level
# File operations
ls -la /sdcard/
cat /path/to/file
cp /source /dest
rm /path/to/file
# Process info
ps -A | grep <name>
pidof <package_name>
top -n 1 -m 10adb shell "logcat -d | head -500"
adb shell "dumpsys activity | head -200"adb install app.apk # Basic install
adb install -r app.apk # Replace existing
adb install -g app.apk # Grant all permissions
adb install -r -g app.apk # Both
adb uninstall com.example.app # Full uninstall
adb uninstall -k com.example.app # Keep data# Start main activity
adb shell monkey -p com.example.app -c android.intent.category.LAUNCHER 1
# Start specific activity
adb shell am start -n com.example.app/.MainActivity
# Start with intent extras
adb shell am start -n com.example.app/.Activity \
-a android.intent.action.VIEW \
-d "myapp://page/123" \
--es "key" "value"
# Force stop
adb shell am force-stop com.example.app
# Clear app data
adb shell pm clear com.example.appadb shell pm list packages # All packages
adb shell pm list packages -3 # Third-party only
adb shell pm list packages | grep term # Filter
adb shell pm path com.example.app # APK location
adb shell dumpsys package com.example.app # Full package infoadb shell pm grant com.example.app android.permission.CAMERA
adb shell pm revoke com.example.app android.permission.CAMERA
adb shell dumpsys package com.example.app | grep permissionadb push local_file.txt /sdcard/
adb pull /sdcard/remote_file.txt ./
# Recursive
adb push local_dir/ /sdcard/target/
adb pull /sdcard/dir/ ./local/adb shell run-as com.example.app ls files/
adb shell run-as com.example.app cat shared_prefs/prefs.xml
adb shell run-as com.example.app sqlite3 databases/app.db ".tables"# Tap at coordinates
adb shell input tap 500 800
# Swipe (x1 y1 x2 y2 [duration_ms])
adb shell input swipe 500 1500 500 500 300
# Text input (needs focused field)
adb shell input text "hello"
# Key events
adb shell input keyevent KEYCODE_HOME # Home
adb shell input keyevent KEYCODE_BACK # Back
adb shell input keyevent KEYCODE_ENTER # Enter
adb shell input keyevent KEYCODE_POWER # Power
adb shell input keyevent KEYCODE_VOLUME_UP # Volume up| Code | Key | Code | Key |
|---|---|---|---|
| 3 | HOME | 4 | BACK |
| 24 | VOL_UP | 25 | VOL_DOWN |
| 26 | POWER | 66 | ENTER |
| 67 | DEL | 82 | MENU |
# Screenshot
adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png
# One-liner (binary-safe)
adb exec-out screencap -p > screen.png
# Screen recording (max 3 min)
adb shell screenrecord /sdcard/video.mp4
adb shell screenrecord --time-limit 10 /sdcard/video.mp4adb shell uiautomator dump /sdcard/ui.xml
adb pull /sdcard/ui.xml# Dump and exit
adb logcat -d
# Last N lines
adb logcat -t 100
# Filter by tag:priority
adb logcat ActivityManager:I *:S
# Filter by package (get PID first)
adb logcat --pid=$(adb shell pidof -s com.example.app)
# Crash buffer
adb logcat -b crash# Find crashes
adb logcat *:E | grep -E "(Exception|Error|FATAL)"
# Activity lifecycle
adb logcat ActivityManager:I ActivityTaskManager:I *:S
# Memory issues
adb logcat art:D dalvikvm:D *:S | grep -i "gc"adb shell dumpsys meminfo com.example.app# ANR traces
adb shell cat /data/anr/traces.txt
# Tombstones (native crashes, needs root)
adb shell ls /data/tombstones/
# Recent crashes via logcat
adb logcat -b crash -dadb shell dumpsys -l # List all services
# Common services
adb shell dumpsys activity # Activities, processes
adb shell dumpsys package <pkg> # Package details
adb shell dumpsys battery # Battery status
adb shell dumpsys meminfo # System memory
adb shell dumpsys cpuinfo # CPU usage
adb shell dumpsys window displays # Display info
adb shell dumpsys connectivity # Network stateadb shell getprop # All properties
adb shell getprop | grep <filter> # Filter properties
# Useful properties
getprop ro.product.model # Model
getprop ro.build.fingerprint # Build fingerprint
getprop ro.serialno # Serial number
getprop sys.boot_completed # Boot status (1 = done)# Namespaces: system, secure, global
adb shell settings get global airplane_mode_on
adb shell settings put system screen_brightness 128
adb shell settings list globaladb reboot # Normal reboot
adb reboot recovery # Recovery mode
adb reboot bootloader # Fastboot mode
adb reboot sideload # Sideload mode
adb reboot-bootloader # Alias for bootloaderadb kill-server && adb start-server-s <serial>/system/bin/<cmd>| Task | Command |
|---|---|
| List devices | |
| Install app | |
| Start app | |
| Stop app | |
| Screenshot | |
| Logs | |
| Shell | |
| Push file | |
| Pull file | |
| Tap | |
| Back | |
| Home | |
references/deep-dive.md