Most Complete ADB Cheat Sheet

The next article from the mobile test automation series will be dedicated to the ADB. All you need to to know- the most basic operations to the most advanced configurations.

ADB, Android Debug Bridge, is a command-line utility included with Google's Android SDK. ADB can control your device over USB from a computer, copy files back and forth, install and uninstall apps, run shell commands, and more.

While ago when we were working on the first version of the BELLATRIX test automation framework, I did this research while I was working on a similar features for our solution.

ADB Basics

adb devices (lists connected devices)

adb root (restarts adbd with root permissions)

adb start-server (starts the adb server)

adb kill-server (kills the adb server)

adb reboot (reboots the device)

adb devices -l (list of devices by product/model)

adb shell (starts the backround terminal)exit (exits the background terminal)

adb help (list all commands)

adb -s <deviceName> <command> (redirect command to specific device)

adb –d <command> (directs command to only attached USB device)

adb –e <command> (directs command to only attached emulator)

Package Installation

adb shell install <apk> (install app)

adb shell install <path> (install app from phone path)