agentleFS
prasad-vennamprasad-vennam/Awesome-Android-AI-Agent-Skills/skills/android-adb-terminal/SKILL.md

android-adb-terminal

Skill11 starsChanged 8 months agoMITView on GitHub

Use when interacting with Android emulators or physical devices via ADB (Android Debug Bridge).

The file

Files
SKILL.md

Android ADB Automation 📲⌨️

Expert commands and scripts for seamless Android device interaction and debugging.

⚡ When to Use

  • App Installation: Installing APKs or bundles.
  • Logcat Debugging: Filtering and searching system logs.
  • Device Interaction: Typing text, tapping buttons, or swiping via shell.
  • Data Cleanup: Clearing application data or cache.
  • Screen Captures: Taking screenshots or recording videos.
  • Port Forwarding: Connecting local servers to the device.

🛠️ Essential Commands

1. Device Discovery

adb devices
adb get-serialno

2. Package & Activity Management

  • Force Stop: adb shell am force-stop <package_name>
  • Launch Activity: adb shell am start -n <package_name>/<activity_name>
  • Clear Data: adb shell pm clear <package_name>
  • List Installed Packages: adb shell pm list packages | grep <filter>

3. Screen Interaction (Agent Favorites)

  • Type Text: adb shell input text "HelloAgent"
  • Tap Coordinate: adb shell input tap 500 500
  • Back Button: adb shell input keyevent 4
  • Unlock Device: adb shell input keyevent 82

4. File Transfers

adb push local_file /sdcard/remote_path
adb pull /sdcard/remote_path local_destination

📜 Advanced Automation

Port Forwarding (Connect Host to Device)

adb forward tcp:8080 tcp:8080

Port Reverse (Connect Device to Host - e.g. Local Backend)

adb reverse tcp:3000 tcp:3000

Advanced Logcat Filtering

adb logcat -v time *:E # All errors with timestamps
adb logcat MyTag:D *:S # Show 'MyTag' debug only, silent for everything else

🧪 Scripting Patterns

Wait for Device Online

adb wait-for-device

Get Screen Dimensions

adb shell wm size

Take and Pull Screenshot

adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png ./screenshot.png

🔗 Related Resources

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.