practical collection of advanced ADB shell commands you can use on Android devices—both unrooted and rooted—including debugging, performance tuning, package control, logs, networking, and system inspection.
I’ll separate them clearly:
1. Installing ADB#
Download Platform-Tools:
- Official link: Android SDK Platform-Tools
Extract the ZIP file to a folder on your computer.
Add ADB to your system PATH (optional but convenient):
- On Windows: add the folder path to Environment Variables → Path.
- On Linux/Mac: add
export PATH=$PATH:/path/to/platform-toolsto your.bashrcor.zshrc.
2. Enabling Developer Options on Android#
- Go to Settings → About Phone → Build Number.
- Tap Build Number 7 times until it says “You are now a developer!”
- Go back to Settings → System → Developer Options.
- Enable USB Debugging.
3. Basic ADB Commands#
After connecting your device via USB:
Check device connection
adb devicesThis lists all connected devices. You may need to allow USB debugging on your phone when prompted.
Install an APK
adb install appname.apkUninstall an app
adb uninstall com.example.appCopy files to/from device
adb push localfile /sdcard/remote_file adb pull /sdcard/remote_file localfileOpen a shell on the device
adb shellReboot the device
adb reboot
4. Advanced Usage#
Logcat (view system logs)
adb logcatScreen recording
adb shell screenrecord /sdcard/demo.mp4Backup & restore
adb backup -apk -all -f backup.ab adb restore backup.ab
5. Wireless ADB#
Connect device via USB.
Enable TCP/IP mode:
adb tcpip 5555Find your device IP:
adb shell ip routeConnect wirelessly:
adb connect DEVICE_IP:5555
Basics (Works on All Devices)#
Enter shell:
adb shellCheck device info:
getprop ro.product.model
getprop ro.build.version.release
uname -aBattery status:
dumpsys batteryScreen resolution & DPI:
wm size
wm densityChange temporarily:
wm size 1080x1920
wm density 420Reset:
wm size reset
wm density resetApp & Package Management (Unrooted)#
List installed packages:
pm list packagesWith paths:
pm list packages -fFind a package:
pm list packages | grep youtubeDisable system app for current user:
pm disable-user --user 0 com.package.nameRe-enable:
pm enable com.package.nameUninstall for current user (safe debloat):
pm uninstall --user 0 com.facebook.katanaClear app data:
pm clear com.package.nameGrant permission:
pm grant com.package.name android.permission.READ_LOGSActivity & Intent Control#
Launch app:
monkey -p com.package.name -c android.intent.category.LAUNCHER 1Start activity:
am start -n com.pkg/.MainActivitySend broadcast:
am broadcast -a android.intent.action.BOOT_COMPLETEDForce-stop:
am force-stop com.pkgLogs & Debugging#
Live logs:
logcatFilter:
logcat ActivityManager:I *:SSave to file:
logcat -d > /sdcard/log.txtKernel messages:
dmesgSystem services:
dumpsys activity
dumpsys meminfo
dumpsys cpuinfoPerformance / Monitoring#
Top processes:
topCPU governor:
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governorRAM info:
cat /proc/meminfoThermal:
dumpsys thermalserviceFPS overlay:
dumpsys SurfaceFlinger --latencyNetworking#
IP address:
ip addr show wlan0Ping:
ping google.comPorts:
netstat -tulpnDNS:
getprop net.dns1File System Access (Limited Unrooted)#
Browse:
ls /sdcardCopy files:
cp /sdcard/file.txt /sdcard/Download/Find files:
find /sdcard -name "*.mp4"ROOT-ONLY ADB SHELL COMMANDS#
Enter root shell:
adb shell
suSystem Mounting#
Remount system writable:
mount -o rw,remount /(Older):
mount -o rw,remount /systemCheck mounts:
mount | grep systemRemove System App (dangerous)#
rm -rf /system/app/AppName
rm -rf /system/priv-app/AppNameBetter:
pm uninstall com.packageCPU Tweaks#
Set governor:
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governorDisable core:
echo 0 > /sys/devices/system/cpu/cpu5/onlineBattery Calibration (legacy)#
rm /data/system/batterystats.bin
rebootProcess Injection / Debug#
List SELinux mode:
getenforceSwitch (temporary):
setenforce 0System Properties#
Change property:
setprop debug.hwui.renderer skiaglView all:
getpropWireless Debugging Tricks#
ADB over Wi-Fi:
adb tcpip 5555
adb connect 192.168.1.5Stop:
adb usbScreenshot / Screenrecord#
Screenshot:
adb exec-out screencap -p > screen.pngVideo:
adb shell screenrecord /sdcard/demo.mp4Important Warnings#
Root commands can:
- Soft-brick devices
- Break OTA updates
- Trigger bootloops
Always backup before modifying /system or /vendor.
