ADB Cheatsheet

ADB Cheatsheet

A list of ADB Commands

List all connected devices

adb list devices
adb list devices -l # Long Output

Enable Wireless ADB on a USB Connected Device

adb tcpip 5555  # 5555 is port, can be changed if needed

adb connect using device IP

adb connect # 5555 is Port

ADB Port Forward

adb forward tcp:808 tcp:8080 # Typing localhost on computer will access mobile server at port 8080

adb forward --remove tcp:8080 # Remove specific forward
adb forward --remove-all # Remove All Port Forwarding

ADB Port Reverse

adb reverse tcp:808 tcp:8080 # Typing localhost on mobile will access computer server at port 8080

adb reverse --remove tcp:8080 # Remove specific reverse
adb reverse --remove-all # Remove All Port reversing

List All Installed Packages

adb shell cmd package list package
adb shell cmd package list package -f # Full Information

Remove bloatware

adb shell pm uninstall --user 0 ``
# Replace package name with your application package name.
# Ex: Package name for WhatsApp: com.whatsapp

Check Multi user Support

adb shell pm list max-users # Outputs more than one on multi-user support

Set/Hack Multi-user Support

adb shell setprop fw.max_users = 5
# This will temporarily set max user value to 5 and new user can be created on unsupported phones


adb shell "dumpsys package | grep -A1 'userId=UID'"
# I think it is used for getting app name from PID.

Original:  Updated: