ADB Command List Recent
Use Ctrl + F shortcut to quickly find the command you need.
1. Functional Commands
| Name | Command | Remarks |
|---|---|---|
| Restart | adb reboot | |
| Restart to recovery | adb reboot recovery | |
| Restart to bootloader | adb reboot bootloader | |
| Shut down | adb shell reboot -p | |
| Restore Device DPI | adb shell wm density reset | |
| Modify Device DPI | adb shell wm density 320 | 320 = custom dpi |
| View Device DPI | adb shell wm density | |
| Restore resolution | adb shell wm size reset | |
| Modify resolution | adb shell wm size 1080x1920 | Custom resolution |
| View resolution | adb shell wm size | |
| View serial number | adb get-serialno | |
| View device details | adb devices -l | |
| View 3rd party packages | adb shell pm list packages -3 | |
| View system packages | adb shell pm list packages -s | |
| View all packages | adb shell pm list packages | |
| View memory usage | adb shell dumpsys meminfo | |
| Clear app data/cache | adb shell pm clear cn.com.test.mobile | Custom package name |
| Uninstall app | adb uninstall cn.com.test.mobile | Custom package name |
| Uninstall (keep data) | adb uninstall -k cn.com.test.mobile | Custom package name |
| Force stop app | adb shell am force-stop cn.com.test.mobile | Custom package name |
| Screenshot | adb shell screencap -p /sdcard/01.png | Custom name |
| Install APK | adb install d:/temp/1.apk | APK absolute path |
| Set battery % | adb shell dumpsys battery set level 100 | Custom percentage |
| Launch app | adb shell am start -ncn.com.test.mobile/.ui.SplashActivity | Package name |
| Check Android version | adb shell getprop ro.build.version.release | |
| Top 10 memory apps | adb shell top -s 10 | |
| View device brand | adb shell getprop ro.product.brand | |
| Turn on WiFi | adb shell svc wifi enable | |
| Turn off WiFi | adb shell svc wifi disable | |
| Enable pointer display | adb shell settings put system pointer_location 1 | |
| Disable pointer display | adb shell settings put system pointer_location 0 | |
| Simulated click | adb shell input tap [x] [y] | x/y coordinates |
| Turn off updates | adb shell pm disable-user com.wssyncmldm | |
| Prevent black screen timeout | adb shell settings put system screen_off_timeout 2147483647 | Run when screen not black |
2. Button Commands
| Name | Command | Remarks |
|---|---|---|
| Power button | adb shell input keyevent 26 | |
| Menu key | adb shell input keyevent 82 | |
| HOME key | adb shell input keyevent 3 | |
| Return key | adb shell input keyevent 4 | |
| Volume up | adb shell input keyevent 24 | |
| Volume down | adb shell input keyevent 25 | |
| Mute | adb shell input keyevent 164 | |
| Play/Pause | adb shell input keyevent 85 | |
| Stop playing | adb shell input keyevent 86 | |
| Next song | adb shell input keyevent 87 | |
| Previous song | adb shell input keyevent 88 | |
| Resume playback | adb shell input keyevent 126 | |
| Pause playback | adb shell input keyevent 127 | |
| Light up screen | adb shell input keyevent 224 | |
| Turn off screen | adb shell input keyevent 223 | |
| Swipe to unlock | adb shell input swipe 300 1000 300 500 | Start x, y, End x, y |
| Enter text | adb shell input text hello | When focus is on text box |
Xiaomi MIUI ADB Optimization Commands
| Name | Command |
|---|---|
| Disable smart services | adb shell pm disable-user com.miui.systemAdSolution |
| Disable Xiaomi e-commerce | adb shell pm disable-user com.xiaomi.ab |
| Disable user feedback | adb shell pm disable-user com.miui.bugreport |
| Disable system analytics | adb shell pm disable-user com.miui.analytics |
| Remove splash screen ads | adb shell rm -f -r /sdcard/Android/data/com.miui.systemAdSolution/files |
| Prevent ads recurring | adb shell touch /sdcard/Android/data/com.miui.systemAdSolution/files |