Skip to main content

Advanced ADB Shell Commands for Android Devices

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
#

  1. Download Platform-Tools:

  2. Extract the ZIP file to a folder on your computer.

  3. 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-tools to your .bashrc or .zshrc.

2. Enabling Developer Options on Android
#

  1. Go to Settings → About Phone → Build Number.
  2. Tap Build Number 7 times until it says “You are now a developer!”
  3. Go back to Settings → System → Developer Options.
  4. Enable USB Debugging.

3. Basic ADB Commands
#

After connecting your device via USB:

  • Check device connection

    adb devices

    This lists all connected devices. You may need to allow USB debugging on your phone when prompted.

  • Install an APK

    adb install appname.apk
  • Uninstall an app

    adb uninstall com.example.app
  • Copy files to/from device

    adb push localfile /sdcard/remote_file
    adb pull /sdcard/remote_file localfile
  • Open a shell on the device

    adb shell
  • Reboot the device

    adb reboot

4. Advanced Usage
#

  • Logcat (view system logs)

    adb logcat
  • Screen recording

    adb shell screenrecord /sdcard/demo.mp4
  • Backup & restore

    adb backup -apk -all -f backup.ab
    adb restore backup.ab

5. Wireless ADB
#

  1. Connect device via USB.

  2. Enable TCP/IP mode:

    adb tcpip 5555
  3. Find your device IP:

    adb shell ip route
  4. Connect wirelessly:

    adb connect DEVICE_IP:5555

Basics (Works on All Devices)
#

Enter shell:

adb shell

Check device info:

getprop ro.product.model
getprop ro.build.version.release
uname -a

Battery status:

dumpsys battery

Screen resolution & DPI:

wm size
wm density

Change temporarily:

wm size 1080x1920
wm density 420

Reset:

wm size reset
wm density reset

App & Package Management (Unrooted)
#

List installed packages:

pm list packages

With paths:

pm list packages -f

Find a package:

pm list packages | grep youtube

Disable system app for current user:

pm disable-user --user 0 com.package.name

Re-enable:

pm enable com.package.name

Uninstall for current user (safe debloat):

pm uninstall --user 0 com.facebook.katana

Clear app data:

pm clear com.package.name

Grant permission:

pm grant com.package.name android.permission.READ_LOGS

Activity & Intent Control
#

Launch app:

monkey -p com.package.name -c android.intent.category.LAUNCHER 1

Start activity:

am start -n com.pkg/.MainActivity

Send broadcast:

am broadcast -a android.intent.action.BOOT_COMPLETED

Force-stop:

am force-stop com.pkg

Logs & Debugging
#

Live logs:

logcat

Filter:

logcat ActivityManager:I *:S

Save to file:

logcat -d > /sdcard/log.txt

Kernel messages:

dmesg

System services:

dumpsys activity
dumpsys meminfo
dumpsys cpuinfo

Performance / Monitoring
#

Top processes:

top

CPU governor:

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

RAM info:

cat /proc/meminfo

Thermal:

dumpsys thermalservice

FPS overlay:

dumpsys SurfaceFlinger --latency

Networking
#

IP address:

ip addr show wlan0

Ping:

ping google.com

Ports:

netstat -tulpn

DNS:

getprop net.dns1

File System Access (Limited Unrooted)
#

Browse:

ls /sdcard

Copy files:

cp /sdcard/file.txt /sdcard/Download/

Find files:

find /sdcard -name "*.mp4"


ROOT-ONLY ADB SHELL COMMANDS
#

Enter root shell:

adb shell
su

System Mounting
#

Remount system writable:

mount -o rw,remount /

(Older):

mount -o rw,remount /system

Check mounts:

mount | grep system

Remove System App (dangerous)
#

rm -rf /system/app/AppName
rm -rf /system/priv-app/AppName

Better:

pm uninstall com.package

CPU Tweaks
#

Set governor:

echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Disable core:

echo 0 > /sys/devices/system/cpu/cpu5/online

Battery Calibration (legacy)
#

rm /data/system/batterystats.bin
reboot

Process Injection / Debug
#

List SELinux mode:

getenforce

Switch (temporary):

setenforce 0

System Properties
#

Change property:

setprop debug.hwui.renderer skiagl

View all:

getprop

Wireless Debugging Tricks
#

ADB over Wi-Fi:

adb tcpip 5555
adb connect 192.168.1.5

Stop:

adb usb

Screenshot / Screenrecord
#

Screenshot:

adb exec-out screencap -p > screen.png

Video:

adb shell screenrecord /sdcard/demo.mp4

Important Warnings
#

Root commands can:

  • Soft-brick devices
  • Break OTA updates
  • Trigger bootloops

Always backup before modifying /system or /vendor.


Youcef
Author
Youcef
My name is youcef and i’m linux user who fool in love with linux , like free and open software .