Command | Description |
---|---|
adb devices |
Lists connected devices by serial |
adb devices -l |
For more information |
adb start-server |
Starts the adb server |
adb kill-server |
Kills the adb server |
adb reboot |
Reboots the device |
adb install <filename> |
Installs an apk |
adb uninstall <packagename> |
Uninstalls an apk |
adb -s <device id> <command> |
Command runs on the specified device |
adb -s <emulator id> emu kill |
Kills the specified emulator |
adb logcat |
Starts printing log messages |
adb logcat -c |
Clears the log buffers |
adb logcat -f <filename> |
Dumps to specified file |
adb wait-for-device <command> |
command will run once the device is connected |
adb shell <shell command> |
run shell commands (see below) |
Enter a remote shell with the command adb shell
, then run commands within
Or issue commands directly via adb without entering a remote shell adb shell <command>
Command | Description |
---|---|
adb shell pm list packages -3 |
Lists all installed 3rd-party packages |
adb shell pm clear <packagename> |
Clears cache and closes app |
adb shell am start -a android.intent.action.VIEW -d <url> |
Can be used to test deeplinks |
adb shell monkey -p <packagename> --throttle <event-delay> <event-count> |
To run UI exerciser monkey tool |
adb shell dumpsys battery set level <number> |
sets device battery level |
adb shell dumpsys battery reset |
reset device battery info |
adb shell settings put system show_touches 1 |
Show taps (System turns them off during screenrecording) |
adb shell input keyevent 4 |
Trigger a back button press |
adb shell setprop debug.layout true |
Show layout bounds |
Allows you to change the status bar for consistent sreenshots
Command | Description |
---|---|
adb shell settings put global sysui_demo_allowed 1 |
enable demo mode |
adb shell am broadcast -a com.android.systemui.demo -e command enter |
enter demo mode |
adb shell am broadcast -a com.android.systemui.demo -e command exit |
exit demo mode |
adb shell am broadcast -a com.android.systemui.demo -e command clock -e hhmm <time> |
set the clock |
adb shell am broadcast -a com.android.systemui.demo -e command notifications -e visible false |
hide notification icons |
Command | Description |
---|---|
ps -x | grep adb |
Find the adb process id (pid) then kill with the following command |
kill -9 <pid> |
Kill the given process |
killall adb |
Kill the given process |
https://developer.android.com/studio/command-line/adb https://android.googlesource.com/platform/frameworks/base/+/master/packages/SystemUI/docs/demo_mode.md