ADB Commands Reference Guide
Setting Up ADB
ADB is part of the Android SDK Platform Tools, available as a standalone download from developer.android.com. Extract the archive, add the folder to your PATH, and plug in a device with Developer Options and USB Debugging enabled. Run adb devices to confirm the phone is recognized. On first connection, the phone will prompt you to authorize the computer; you must accept before most commands work.
Device Information Commands
Useful information commands: adb devices (list connected devices), adb get-serialno (the device serial), adb shell getprop ro.build.version.release (Android version), adb shell wm size (screen resolution), adb shell dumpsys battery (battery status), and adb shell pm list packages (all installed packages). These commands are all read-only and safe to run on any device.
App Management Commands
App management commands: adb install app.apk (install), adb uninstall com.package.name (uninstall for user only — does not require root), adb shell pm disable-user com.package.name (disable without uninstalling), adb shell pm clear com.package.name (clear app data), and adb shell am force-stop com.package.name (force-stop a running app). These are the building blocks for most Android customization.
Safe Debloating Workflow
Safe debloating uses pm uninstall -k --user 0 com.package.name, which removes the app for the current user while preserving the system install. This means a factory reset restores the package, minimizing risk. List packages with adb shell pm list packages | grep keyword to find candidates, test one at a time, reboot, and verify nothing is broken before moving to the next package. Never uninstall packages you do not recognize.
Logcat and Debugging
Logcat is the Android system log. adb logcat streams live; adb logcat -d dumps the current buffer and exits; adb logcat -c clears it. Filter with tags: adb logcat TAG:V *:S shows only messages from TAG at Verbose level. Filter with packages: adb logcat --pid=$(adb shell pidof com.example.app) shows only messages from one app. Critical for debugging app behavior and reverse-engineering.
Screen Capture and Recording
adb exec-out screencap -p > screen.png captures a PNG screenshot with no file shuffling. adb shell screenrecord /sdcard/video.mp4 records up to three minutes of screen video. Pull the file with adb pull /sdcard/video.mp4. These commands do not require root and are the fastest way to grab captures without navigating phone UI.
Commands to Avoid
Certain ADB commands can brick a device or corrupt data. Never run adb shell rm -rf / (wipes filesystem), adb reboot bootloader followed by fastboot flash with an incorrect image (can brick), or adb shell pm uninstall for system packages without --user 0 (can require factory reset). If a command requires root and your device is not rooted, it will fail safely; if it requires root and your device is rooted, double-check before executing.
Common Troubleshooting
If adb devices shows the device as unauthorized, replug the USB cable and accept the authorization prompt on the phone. If it shows offline, revoke USB debugging authorizations in Developer Options and reauthorize. If the device does not appear, check the USB cable (many data cables are charge-only), try a different USB port, and make sure USB Debugging is enabled in Developer Options. Cable issues are the most common cause of ADB problems.
More Guides
- 25 Phone Hacks Everyone Should Know
- Android Developer Mode Guide
- Android Debloating Without Root
- 30 Hidden iPhone Features
- Privacy Hardening Guide
- Carrier Unlock Codes
- Signal Isolation & Faraday Bags
- ADB Commands Reference
- Battery Optimization Guide
- Phone Security Basics
- Juice Jacking & Public Charging
Legal & Safety Disclaimer
All information on Hack Any Phone is for educational purposes only. Modifying your device can void warranties or cause instability. Always back up your data. We do not condone illegal activities such as IMEI changing or unauthorized network unlocking.