Installing an APK from the terminal, pulling files off a phone, checking system logs, or opening a shell directly on an Android device all come back to the same tool: ADB, short for Android Debug Bridge.
The name makes it sound more complicated than it is.
You don't need Android Studio, Gradle, or a full Android development environment to use it. Google ships ADB as part of a standalone package called Android SDK Platform-Tools, and once it's installed, a handful of terminal commands are enough to communicate directly with a device.
This guide covers how ADB works, how to install it on Windows, macOS, and Linux, how to connect a phone, and the commands you'll reach for most often.
What this covers:
What ADB is and how its three components fit together
Installing Platform-Tools on Windows, macOS, and Linux
Enabling USB debugging and connecting a device
The most useful ADB commands, including wireless debugging
Common connection problems and how to fix them
What Is ADB?
Android Debug Bridge (ADB) is a command-line tool that lets a computer communicate with an Android device. It can be used to:
Install and uninstall APK files
Copy files between a computer and a phone
Open a shell on an Android device
View system logs
Inspect installed packages
Run commands on a phone
Reboot the device
Capture screenshots
Connect to Android devices wirelessly
Debug Android applications
ADB is included in Google's Android SDK Platform-Tools package, which can be downloaded separately without installing Android Studio.
Download Android SDK Platform-Tools from Google
How ADB Actually Works
Before running commands, it helps to know what's happening behind the scenes. ADB has three main components.
The ADB Client
This is the adb command run from a terminal, for example:
adb devicesThe client receives the command and sends it to the ADB server.
The ADB Server
The server runs in the background on the computer and manages communication with connected Android devices. By default, it listens on TCP port 5037. It doesn't need to be started manually: running any ADB command starts the server automatically if it isn't already running.
The ADB Daemon
The device runs a background process called adbd. This is the component that actually receives and executes ADB commands on Android.
The basic flow looks like this:
Terminal
↓
ADB client
↓
ADB server
↓
adbd on Android
↓
PhoneThat's the entire concept: a bridge between a computer and an Android device.
What You Need
An Android phone or tablet
A USB data cable
A computer
Android SDK Platform-Tools
USB debugging enabled on the Android device
Android Studio is not required. Google provides standalone Platform-Tools packages for Windows, macOS, and Linux.
Step 1: Install ADB
Windows
Download the Windows version of Android SDK Platform-Tools and extract it somewhere convenient, for example:
C:\platform-toolsThen add that directory to the Windows PATH:
Press the Windows key.
Search for
environment variables.Open Edit the system environment variables.
Click Environment Variables.
Under either User Variables or System Variables, select
Path.Click Edit.
Click New.
Add
C:\platform-tools.Open a new PowerShell or Windows Terminal window.
Test it:
adb versionIf everything is configured correctly, Windows displays the installed ADB version. On some devices, an OEM USB driver is also needed before ADB can detect the phone.
macOS
Download the official Platform-Tools archive, or install ADB through Homebrew:
brew install android-platform-toolsVerify with:
adb versionIf Platform-Tools was extracted manually to ~/platform-tools, add it to the PATH:
echo 'export PATH="$PATH:$HOME/platform-tools"' >> ~/.zshrc
source ~/.zshrcThen confirm:
adb versionLinux
Download and extract the Linux Platform-Tools archive, for example:
mkdir -p ~/platform-toolsExtract the archive into that directory, then add it to the PATH:
echo 'export PATH="$PATH:$HOME/platform-tools"' >> ~/.bashrc
source ~/.bashrcCheck the installation:
adb versionOn Ubuntu and several other distributions, additional USB permissions may be required before a device is detected. Google recommends setting up the appropriate udev rules and, on Ubuntu, adding the user account to the plugdev group.
Step 2: Enable USB Debugging on Android
ADB cannot access a phone just because a USB cable is connected. Android requires debugging to be enabled explicitly.
First, enable Developer options by opening Settings → About phone → Build number, then tapping Build number seven times. On some devices, this setting is located under Settings → About phone → Software information → Build number instead. After the required number of taps, Android confirms that Developer options have been enabled.
Go back to Settings, open Developer options, and enable USB debugging. The exact menu location varies between manufacturers and Android versions.
Step 3: Connect Your Phone
Connect the Android phone to the computer with a USB data cable, then run:
adb devicesThe first connection triggers an authorization prompt on the phone asking whether to trust the computer. Accept it, then run the command again:
adb devicesThe output should look similar to this:
List of devices attached
9A141FFAZ0036 deviceThe word device confirms that ADB can communicate with the phone. If it says unauthorized instead, unlock the phone and accept the USB debugging prompt. If no devices appear at all, see the troubleshooting section below.
The Most Useful ADB Commands
Once the phone is connected, this is where ADB becomes useful.
Check Connected Devices
adb devicesThis is usually the first command to run. For more detail:
adb devices -lThe -l option displays additional device information.
Install an APK
To install an APK directly:
adb install app.apkOr specify the full path:
adb install ~/Downloads/app.apkOn Windows:
adb install C:\Users\YourName\Downloads\app.apkThis is particularly useful when testing an Android build directly from a computer.
Uninstall an App
With a known package name:
adb uninstall com.example.appFor example:
adb uninstall com.facebook.katanaInstalled package names can be found with:
adb shell pm list packagesTo search for a specific package on macOS or Linux:
adb shell pm list packages | grep facebookOn Windows PowerShell:
adb shell pm list packages | Select-String facebookPush Files to Your Phone
adb push copies files from a computer to an Android device:
adb push ~/Downloads/podcast.mp3 /sdcard/Music/Or an image:
adb push photo.jpg /sdcard/Pictures/Pull Files From Your Phone
adb pull does the opposite:
adb pull /sdcard/DCIM/Camera/IMG_001.jpg ~/Desktop/An entire directory can be pulled the same way:
adb pull /sdcard/DCIM/Camera ~/Desktop/CameraOpen an Android Shell
One of the most powerful ADB commands opens a shell directly on the device:
adb shellFrom there, standard commands work as expected:
ls
pwd
df -hLeave the shell with:
exitA single command can also be run without opening an interactive shell:
adb shell df -hOr:
adb shell getpropView Android Logs
ADB can stream system logs in real time using logcat:
adb logcatTo see only error-level messages:
adb logcat *:EThis is especially useful when troubleshooting an app that crashes or behaves unexpectedly. Stop the stream with Ctrl + C.
Reboot Your Phone
Restart the device:
adb rebootReboot into recovery:
adb reboot recoveryOr into bootloader/fastboot mode:
adb reboot bootloaderNote: ADB itself is relatively safe, but commands performed after entering recovery or bootloader mode can modify or erase device data. Proceed carefully.
Take a Screenshot
Capture a screenshot directly from the device:
adb exec-out screencap -p > screenshot.pngThis saves the image to the computer.
Record Your Screen
Record the Android screen:
adb shell screenrecord /sdcard/screen.mp4Stop the recording with Ctrl + C, then copy it to the computer:
adb pull /sdcard/screen.mp4Using ADB With Multiple Devices
If more than one Android device is connected, ADB may respond with:
error: more than one device/emulatorList the connected devices:
adb devicesThen target a specific one by its serial number:
adb -s 9A141FFAZ0036 shellThe same -s option works with other commands:
adb -s 9A141FFAZ0036 install app.apkThis becomes especially useful when working with multiple phones or emulators at once.
Use ADB Over Wi-Fi
A USB cable isn't always necessary. Modern Android versions support wireless debugging, which lets ADB communicate with a device over Wi-Fi.
On supported devices, open Settings → Developer options → Wireless debugging, enable it, and use Android's pairing option. From the computer, pair using:
adb pair IP_ADDRESS:PAIRING_PORTEnter the pairing code displayed on the phone. After pairing, connect to the device:
adb connect IP_ADDRESS:PORTThen verify:
adb devicesThe wireless device should now appear in the list. This setup is particularly convenient when repeatedly installing and testing an app, since it removes the need to keep a cable connected.
Useful ADB Commands at a Glance
Command | What it does |
|---|---|
| List connected devices |
| List devices with additional information |
| Install an APK |
| Uninstall an app |
| Copy files to Android |
| Copy files from Android |
| Open an Android shell |
| Run a shell command |
| View Android logs |
| Restart the device |
| Reboot into recovery |
| Reboot into bootloader |
| Capture a screenshot |
| Record the screen |
| Pair with a device wirelessly |
| Connect to a wireless device |
| Stop the ADB server |
| Start the ADB server |
Common ADB Problems
ADB is generally straightforward once configured, but connection issues are common.
adb: command not found
The computer can't find the ADB executable. Check the installation:
adb versionIf that fails, confirm the Platform-Tools directory is in the PATH, or run ADB directly from its folder:
./adb devicesThe Device Says unauthorized
Run:
adb devicesIf the output shows:
XXXXXXXX unauthorizedunlock the phone, accept the USB debugging authorization prompt, and run adb devices again.
No Devices Are Listed
Check that:
USB debugging is enabled
The phone is unlocked
The cable is a data-capable USB cable, not charge-only
The USB connection itself is working
The correct USB driver is installed on Windows, if required
The Linux user account has the required USB permissions
Then restart the ADB server:
adb kill-server
adb start-server
adb deviceserror: protocol fault
This usually indicates a stale or broken ADB connection. Restart the server:
adb kill-server
adb start-serverThen reconnect the phone and try adb devices again.
more than one device/emulator
ADB found multiple targets. Specify the one to use:
adb -s DEVICE_SERIAL shellFind the serial number with adb devices.
ADB Isn't Just for Android Developers
ADB is often introduced as a developer tool, but building Android applications isn't a requirement for finding it useful. It helps with:
Sideloading APKs
Moving files between devices
Troubleshooting Android problems
Collecting crash logs
Automating repetitive Android tasks
Testing applications
Inspecting installed packages
Capturing screenshots and screen recordings
Connecting to Android devices wirelessly
Because ADB is command-line based, it can also be scripted. Combining ADB commands with shell scripts and other tools turns a manual, repetitive task into an automated one.
ADB vs Android Studio
These aren't competing options. Android Studio is a complete development environment: an editor, debugger, emulator, Gradle integration, profiling tools, and more. ADB is simply a command-line communication tool.
For communicating with a phone from a terminal, Platform-Tools alone is enough. For building Android applications, Android Studio uses the ADB installation bundled with the Android SDK.
Key Takeaways
ADB (Android Debug Bridge) works without Android Studio through the standalone Platform-Tools package
It has three components: the client on the computer, the server running in the background, and the
adbddaemon on the deviceUSB debugging must be enabled in Developer options before a device will connect
Core commands cover installing and uninstalling apps, pushing and pulling files, viewing logs, and opening a shell
Wireless debugging removes the need for a USB cable once a device has been paired
Most connection problems are fixed by restarting the ADB server or re-authorizing the device
Conclusion
ADB looks intimidating at first mostly because Google's documentation is written with Android development workflows in mind. The underlying concept is simple: a computer runs the ADB client and server, an Android device runs adbd, and once USB debugging is enabled and the device is authorized, the two can talk to each other.
Start with the basics: adb devices, adb shell, adb push, adb pull, adb install, and adb logcat cover most day-to-day needs. Everything else can be looked up as it comes up.
That's the real advantage of ADB: direct command-line access to an Android device without a full IDE sitting in between.
Frequently Asked Questions
Do you need Android Studio to use ADB? No. ADB is included in Android SDK Platform-Tools, which Google distributes as a standalone package.
Is ADB available on Windows, Mac, and Linux? Yes. Google provides Platform-Tools packages for all three.
Is ADB safe to use? ADB is a legitimate Android debugging interface. Enabling USB debugging gives an authorized computer additional access to the device, so only trusted computers should be authorized.
Can ADB be used without root? Yes. Most common ADB commands work on ordinary, non-rooted devices. Some operations require elevated privileges or are restricted by Android's security model.
Can ADB work over Wi-Fi? Yes. Supported Android devices can use wireless debugging to pair and connect without a USB cable.
What's the difference between ADB and Fastboot? ADB communicates with Android while the operating system is running. Fastboot communicates with the device's bootloader, typically for flashing system images or other bootloader-level operations.
Have a specific ADB error that isn't covered here? Drop the exact message in the comments and I'll help track it down.




