Installing and using Android Debug Bridge

Enabling ADB on the target device

  1. Enable the "Developer Options":

    • Go to "Settings" > "About Device"

    • Find the "Build Number"

    • Press on it 7 times

    • You should get a popup saying "You are now a developer"

  2. Go to "Settings" > "System" > "Developer Options"

  3. Enable "USB debugging"

Installing on Windows

Installing drivers:

  1. Download the ADB driver from Android's website

  1. Unpack it into any folder

  2. TODO

Installing adb tools:

  1. Download platform-tools from Google's website

  1. Unpack it into any folder on your computer

Running ADB commands on Windows

To run a command starting with adb:

  1. Open the terminal in the folder to which you extracted platform-tools

    • Open the folder in Explorer

    • Press <Shift+Right Click>

    • Select "Open Command Prompt Here" or "Open in Powershell"

    • If you chose to open Powershell, type cmd in the window that appears and press Enter

  2. Paste the command into the terminal and press enter

    • <Ctrl+V> does not work in the terminal. You can use <Right Click> or <Shift+Insert> instead

Installing on Linux

ADB drivers are built into the Linux kernel already. You only have to download the ADB tool from you package manager. The package may be named android-tools, platform-tools and adb.

Running scripts

Scripts can be of two kind: ones that are designed to ran on-device, and ones which are designed to be ran on the host machine.

Host scripts contain commands that start with adb, while on-device ones do not.

Running host scripts depends on your operating system, but can usually be achieved by typing the filename of the script in the terminal.

To run an on-device script:

  1. Run adb push <script> /data/local/tmp/

  2. Run adb shell. In the shell run:

    • cd /data/local/tmp/

    • chmod +x <script> (can usually be autocompleted by pressing <Tab>)

    • ./<script>