Skip to content

Android Debug Bridge (adb) snippets

Poweroff the phone

Bash
adb shell reboot -p

Kill the running ADB server

Bash
adb kill-server

List devices

Bash
adb devices

Run a command specifically for the running emulator or the connected physical device

Bash
1
2
3
4
adb -d <command> # command for device
adb -e <command> # command for emulator
adb -s <deviceid> # specify target
# or just set an environment variable ANDROID_SERIAL='<deviceid>'

Shell commands

Open the shell

Bash
adb shell

(Un)Install an app

Bash
adb install file.apk
adb uninstall com.app.www

Start (open) an app

Bash
adb shell monkey -p com.app.www 1 # starts main activity (opens the app, usually)

Wifi ADB

PowerShell
1
2
3
# 192.168.1.34 is the LAN IP of the android device
adb pair 192.168.1.34:38437
adb connect 192.168.1.34:35645