Skip to content

Published

ADB commands: a guide to the Android Debug Bridge ​

In short: ADB, the Android Debug Bridge, is Google's command-line tool for working with an Android phone from a computer, over USB or Wi-Fi. With it you install apps, read logs, copy files, take screenshots and run shell commands on the phone. It comes in Android SDK Platform-Tools for Windows, macOS and Linux.

This guide covers what ADB is, how to set it up, and the commands people use most, each with its own page of flags, examples and fixes for the errors it gives.

Free for up to 3 phones, with no account. Pro adds workflows, schedules and AI for up to 25 phones from £12 a month + VAT.

How ADB works ​

ADB has three parts. The client is the adb command you type on your computer. The server runs in the background on your computer, listens on TCP port 5037 and keeps track of connected phones; the first adb command starts it. The daemon, adbd, runs on the phone and carries out the commands. That is why adb kill-server fixes so many connection problems: the next command starts a fresh server.

Set up ADB ​

  1. On the phone, open Settings, then About phone, and tap Build number seven times to turn on Developer options.
  2. In Developer options, turn on USB debugging.
  3. On the computer, download Android SDK Platform-Tools from Google's Android developer site and unzip it, or install it with a package manager.
  4. Connect the phone with a USB cable, unlock it and tap Allow when it asks whether to allow USB debugging.
  5. In a terminal, run adb devices. The phone is listed with the word device when it is ready.
ComputerGetting Platform-Tools
WindowsDownload the ZIP for Windows from Google, unzip it (for example to C:\platform-tools) and add that folder to your PATH. Some phones also need their maker's USB driver.
macOSbrew install --cask android-platform-tools, or the ZIP from Google.
Linuxsudo apt install adb on Debian and Ubuntu, or the ZIP from Google. If adb says "no permissions", your user needs a udev rule for the phone.

Prefer no cable? On Android 11 and newer, ADB over Wi-Fi pairs the phone with a code instead.

The commands you will use ​

CommandWhat it does
adb devices -lLists connected phones with their serial numbers and models
adb install app.apkInstalls an app from your computer
adb uninstall com.example.appRemoves an app by its package name
adb shellOpens a shell on the phone; adb shell followed by a command runs just that command
adb logcatShows the phone's log as it happens
adb push report.pdf /sdcard/Download/Copies a file to the phone
adb pull /sdcard/DCIM/CameraCopies files from the phone
adb exec-out screencap -p > screen.pngSaves a screenshot on your computer (bash)
adb rebootRestarts the phone
adb kill-serverStops the ADB server; the next command starts it again

Each has a page of its own:

GuideWhat it covers
adb installInstall an APK or split APKs, and fix the errors installs give.
adb uninstallRemove an app, keep its data, or find its package name.
adb shellRun commands on the phone: apps, settings, input and system details.
adb logcatRead, filter and save the phone’s log, and find why an app crashed.
adb devicesList connected phones and fix unauthorized, offline and missing ones.
ADB over Wi-FiWireless debugging with adb pair, adb connect and adb tcpip.
adb screenshot and screenrecordTake screenshots and record the screen from your computer.
adb push and pullCopy files and folders between your computer and the phone.

Want a command written for you? The free ADB command builder builds it for one phone or every phone, in bash or PowerShell, with the right quoting.

Working with several phones ​

When more than one phone is connected, adb needs to know which one you mean:

  • adb -s R58M12345 install app.apk sends the command to the phone with that serial number; adb devices lists them.
  • -d chooses the only phone connected by USB, -e the only emulator, and -t a transport ID from adb devices -l.
  • Setting the ANDROID_SERIAL environment variable picks a phone for every command; -s overrides it.

To run a command on every phone, loop over the phones that adb devices lists as ready:

bash
for s in $(adb devices | awk 'NR>1 && $2=="device" {print $1}'); do
  adb -s "$s" shell getprop ro.product.model
done
powershell
adb devices | Select-Object -Skip 1 | ForEach-Object {
  $serial, $state = $_ -split '\s+'
  if ($state -eq 'device') { adb -s $serial shell getprop ro.product.model }
}

A loop is fine for a handful of phones. With ten or a hundred, you also want to see every screen, know which phone failed and why, and take over one by hand. That is what BenchFleet is for: every connected phone on one screen, one click to take control, and on Pro, group actions that install, launch, reboot or take screenshots on many phones at once. See controlling many Android phones from one PC and, for one phone on your desk, how to control an Android phone from a PC.

ADB and Google's Android CLI ​

In 2026 Google added Android CLI, a command-line tool for building and running Android apps from a terminal or from an AI agent, with commands such as android run and android screen capture. Google describes it as a way to build Android apps with any tool or agent; adb stays the general tool for the phone itself, with its files, settings, other apps and system log. Google's Android CLI documentation has the details.

Questions ​

What is the Android Debug Bridge used for?

Developers and testers use ADB to install and remove apps, read the system log, copy files, record the screen and run shell commands on a phone or emulator from a computer. Tools such as Android Studio, scrcpy and BenchFleet use it to talk to phones.

How do I get the Android Debug Bridge?

Download Android SDK Platform-Tools from Google's Android developer site, unzip it, and run adb from that folder or add the folder to your PATH. On a Mac, Homebrew installs it as android-platform-tools; on Debian and Ubuntu, the adb package does.

Should I leave USB debugging on or off?

Turn it off on your own phone when you do not need it, because a computer you have allowed can install apps and read data through it. On test phones that stay connected to your own computer, leaving it on is normal.

Can I unlock a phone with ADB?

Not one you cannot get into. ADB works only after USB debugging has been turned on and the computer allowed on the unlocked phone, so it is no way around a forgotten PIN, pattern or password.

Can I use ADB without a computer?

ADB runs on a computer and talks to the phone. A few apps run commands on the same phone through Wireless debugging, but installing builds, collecting logs and copying files from a computer all need adb on that computer.

Can I run ADB commands on several phones at once?

Yes. Each command goes to one phone, chosen with -s and its serial number, so you repeat it for each phone or run it in a loop over adb devices. The ADB command builder writes that loop for bash and PowerShell, and BenchFleet runs group actions on many phones for you.

Start with the Free plan

Free for up to 3 phones, with no account. Pro adds workflows, schedules and AI for up to 25 phones from £12 a month + VAT.