ADB Commands Cheat Sheet
Connect devices, install APKs, pull logs, and fix common errors. Every command is searchable and copy-ready in this ADB Commands Cheat Sheet.
What Is ADB
Android Debug Bridge is a command line tool that lets a computer talk directly to an Android device.
It ships inside the Android SDK Platform-Tools package and works over USB or Wi-Fi.
ADB does not care what brand the phone is. Samsung, Pixel, OnePlus, it treats them the same way once a connection opens.
That consistency matters more than it sounds. Statista figures show more than 24,000 distinct Android device variants existed in 2024, with Samsung alone responsible for close to 40% of that count.
StatCounter data puts the number of active Android devices worldwide at close to 3.9 billion, roughly 73% of the global mobile OS market.
A single low-level tool that works the same way across that much hardware diversity is not a nice-to-have. It is close to the only practical option for debugging, testing, and shipping apps at scale.
Most developers first meet ADB through Android Studio, Google's official IDE, which bundles it automatically.
Day-to-day Android development work, from installing a test build to pulling a crash log, runs through this same bridge.
ADB versus Fastboot
|
Tool |
Works When |
Typical Use |
|---|---|---|
|
ADB |
Android OS is booted and running |
Shell access, installs, logs, file transfer |
|
Fastboot |
Device sits in bootloader mode |
Flashing partitions, unlocking bootloader |
ADB Architecture: Client, Server, and Daemon
ADB runs as three separate pieces that talk to each other.
Client: the command you type in a terminal on your computer.
Server: a background process on your machine that manages every connected device.
Daemon (adbd): a small process running on the Android device itself, listening for the server's instructions.
A command like adb shell never touches the phone directly. It travels client to server to daemon, and the reply comes back the same path.
How to Install ADB on Windows, Mac, and Linux
Installing ADB means installing the Android SDK Platform-Tools package, not a standalone app.
Stack Overflow's 2024 Developer Survey found 59.2% of developers use Windows for personal development, with macOS at 31.8% and Ubuntu at 27.7%.
That split is exactly why the steps below cover all three systems rather than picking one.
|
OS |
Install Method |
Verify Command |
|---|---|---|
|
Windows |
Download platform-tools ZIP, add folder to PATH |
|
|
Mac |
|
|
|
Linux |
|
|
Installing ADB on Windows
Download the platform-tools ZIP from developer.android.com and extract it somewhere permanent, like C:\platform-tools.
Add that folder path to Environment Variables under PATH.
Open a new command prompt and run adb --version to confirm it works.
If you would rather skip the manual download, installing Android Studio pulls the same platform-tools in automatically.
Installing ADB on Mac
Homebrew route: run brew install android-platform-tools, and Homebrew handles the PATH setup on its own.
This stays current every time you run brew upgrade, no manual re-downloading required.
Once installed, adb devices works from Terminal, or from the integrated terminal in VS Code if that is where you already work.
Installing ADB on Linux
Ubuntu and Debian-based distributions install ADB straight through the package manager.
Run sudo apt install android-tools-adb android-tools-fastboot, and both land in PATH immediately.
Arch-based systems use sudo pacman -S android-tools instead.
Manual extraction of the platform-tools ZIP works the same way it does on Windows, useful when a distro's packaged version lags behind Google's latest release.
How to Connect a Device to ADB
Connecting a device to ADB means enabling USB debugging, plugging in, and approving a one-time authorization prompt.
Android ships across more than 1,300 manufacturers, and the exact menu path to reach debugging settings shifts depending on the skin. A Samsung phone buries it differently than a Pixel does.
Enabling USB Debugging
Open Settings, tap Build Number seven times under About Phone, and a hidden developer options menu appears.
Toggle USB Debugging on inside that menu.
Plug the phone in with a data-capable cable. Cheap charge-only cables are a common reason a connection silently fails.
A prompt appears on the phone asking to trust the computer's RSA key. Tapping Allow finishes the authorization for that machine.
This same setup is what most guides mean by connecting a phone to Android Studio over USB, since the OS-level permission is identical whether ADB runs standalone or inside an IDE.
Verifying Connection with adb devices
Run adb devices in a terminal.
A connected, authorized device shows its serial number followed by the word "device."
unauthorized next to the serial means the RSA prompt was never approved on the phone screen, or got dismissed by accident.
offline usually clears after unplugging and reconnecting the cable, or after an adb kill-server and adb start-server cycle.
An Android emulator instance, if one is running, shows up here too, listed as emulator-5554 rather than a hardware serial.
Basic ADB Commands for Device Management
These commands form the daily baseline almost every ADB session starts from.
adb devices: lists every connected device or emulator, authorized or not.
adb shell: drops into a command line running directly on the Android device.
adb version: confirms which build of ADB is currently installed on the computer.
adb reboot: restarts the device normally, no flags needed.
Three reboot variants exist beyond the plain restart.
adb reboot recovery boots into Recovery Mode, used for sideloading OTA packages or wiping cache partitions.
adb reboot bootloader drops the device into Bootloader mode instead, which is Fastboot's territory rather than ADB's.
Google's own Firebase Test Lab issues this exact reboot command between automated test runs, to guarantee a clean device state for every test.
Server management rounds out the basics.
adb kill-server followed by adb start-server resets the connection entirely, the standard fix when a device suddenly stops responding.
adb get-state returns a single word (device, offline, or unauthorized), useful for scripting connection checks without parsing the full adb devices output.
ADB File Transfer Commands
File transfer commands move files between a computer and a device's storage, nothing more.
Frameworks used across mobile application development, including Flutter and React Native, both shell out to these same push and pull commands behind the scenes during local builds.
adb push Command
adb push local_path device_path copies a file from the computer onto the device.
A typical example: adb push app-debug.apk /sdcard/Download/
-
Works for single files or entire folders
-
Fails silently on protected system paths without root access
-
Destination folder must already exist on the device
adb pull Command
Pulling works the opposite direction, from device back to computer.
adb pull device_path local_path grabs a file, and the -a flag preserves the original file timestamps during the copy.
QA teams reach for this constantly to pull crash dumps, SQLite databases, or screenshots off a test device.
That beats needing an emulator or a rooted device just to access the same files. Permission errors on /data/data/ paths are common, and usually mean the target app is not debuggable.
ADB App and Package Management Commands
Package management commands install, remove, and inspect apps on a connected device.
AppsFlyer's 2025 uninstall benchmark report found more than half of all app installs get removed within 30 days. That churn rate is exactly what these commands are built to test against, over and over, without touching an app store.
|
Command |
Purpose |
Common Flag |
|---|---|---|
|
|
Push an APK onto the device |
|
|
|
Remove an app by package name |
|
|
|
List installed packages |
|
|
|
Wipe an app's local data |
none |
Installing and Uninstalling Apps
Install: adb install path/to/app.apk pushes a build straight to the device, handling apk installation without waiting on a store review.
Reinstall over existing data: add -r to update an app without wiping its storage.
Force a downgrade: the -d flag installs an older version number over a newer one, normally blocked by Android.
Uninstall: adb uninstall com.example.app removes it completely, matching by package name rather than the visible app name.
Whether a build started life as an APK or an AAB does not matter here. adb install only ever accepts the compiled APK format, and this shortcut has become part of most teams' internal app deployment routine for test builds.
Listing and Managing Packages
Google pulled roughly 1.8 million low-quality or malicious apps from the Play Store during a 2024 cleanup.
That is a reminder that auditing exactly what sits on a test device is worth doing before assuming a bug is your own code's fault.
adb shell pm list packages dumps every installed package name.
Add -3 to see only third-party apps, skipping the dozens of system packages that ship with the OS.
adb shell dumpsys package com.example.app returns version codes, permissions, and install source for a single package in far more detail than the list command alone.
Clearing data with adb shell pm clear com.example.app resets an app to its first-launch state, faster than a full uninstall and reinstall cycle. Google's own Play Console documentation recommends exactly this step during update testing, to catch data-migration bugs before a release ships.
ADB Device Information and Diagnostics Commands
Diagnostics commands pull hardware and software details straight off the device, no dashboard required.
StatCounter's Q1 2024 data shows 68% of global Android sessions happen on fewer than 20 phone models, which is why teams increasingly script these commands instead of checking specs one device at a time.
Android 14 currently leads active installs at roughly 34.7%, with Android 13 and Android 12 trailing at 17.5% and 12.5% respectively, according to 2025 platform distribution data. That spread is fragmentation made visible, and it is exactly what these commands expose in seconds.
|
Command |
Data Returned |
Common Use |
|---|---|---|
|
|
Full build and hardware properties |
Checking OS version, model, manufacturer |
|
|
Battery level, charging state, health |
Diagnosing drain complaints |
|
|
Current screen resolution |
Testing layout across screen sizes |
|
|
Current value of a system setting |
Reading configuration without opening Settings |
Battery, Memory, and CPU Diagnostics
Battery: adb shell dumpsys battery reports charge level, temperature, and whether the device thinks it is charging.
Memory: adb shell dumpsys meminfo com.example.app breaks down exactly how much RAM one process uses, sorted by category.
CPU: adb shell dumpsys cpuinfo lists per-process CPU load, useful for spotting a runaway background service.
These same numbers feed the metrics Google surfaces server-side as Android vitals, just captured locally instead of waiting on aggregated Play Console data.
Screen and Display Properties
adb shell wm size returns the active screen resolution in pixels.
adb shell wm density shows the current DPI, the number that decides how large UI elements render on that specific screen.
A Pixel and a Samsung flagship can report wildly different density values despite similar physical screen sizes. Relying on one test device alone is risky for exactly this reason.
Reading a setting and changing one are two different commands.
adb shell settings get system screen_brightness reads a value.
adb shell settings put system screen_brightness 150 changes it, handy for scripting consistent screenshot conditions across a device farm.
ADB Logging and Debugging Commands
Logging commands capture what is happening inside a device in real time, or as a single point-in-time snapshot.
Instabug's 2025 stability report puts Android's median crash-free session rate at 99.80%, trailing iOS at 99.91%.
AppSamurai's data, citing USamp research, found that 62% of people uninstall an app the moment it crashes or throws an error.
That gap between "almost stable" and "actually stable" is exactly where these commands live.
Firebase Crashlytics and Sentry both ingest crash data that traces back to the same underlying logs adb logcat and adb bugreport expose locally, just aggregated at scale.
Using logcat for Real-Time Logs
adb logcat streams every log line the device produces, tagged by process and severity.
-
Filter by tag:
adb logcat -s TagName -
Filter by app: pair with
adb shell pidof com.example.app -
Clear the buffer:
adb logcat -cfirst, for a clean read
Severity climbs from Verbose and Debug up through Warning, Error, and Fatal.
Piping the output to a file, adb logcat > log.txt, turns a scrolling stream into something you can actually search.
Generating a Full Bug Report
adb bugreport captures a single zipped snapshot instead of a live stream.
That file bundles system logs, running processes, memory state, and recent logcat history into one package.
QA teams attach it directly to tickets, since it feeds straight into whatever defect tracking system a team already runs.
Generation time varies by device, often 30 seconds to a few minutes on older hardware.
The output lands as a .zip file in the current directory, unless a different path is given after the command.
ADB Network and Wireless Commands
Network commands let ADB work without a physical USB connection tying the phone to the computer.
Stack Overflow's 2024 Developer Survey found React Native holds 58.3% developer preference for cross-platform work, a workflow that leans on exactly these commands every time its dev server talks to a device.
Frameworks built for cross-platform app development, React Native and Flutter included, both route debug traffic through ADB's networking layer rather than reinventing it.
|
Mode |
Setup Required |
Best For |
|---|---|---|
|
USB debugging |
Cable, driver, one-time pairing |
Stable, low-latency sessions |
|
Wireless ADB |
Same Wi-Fi network, initial USB handshake |
Device farms, cable-free testing |
Enabling Wireless ADB
Connect the device over USB first and confirm it with adb devices.
Run adb tcpip 5555 to switch the daemon into network mode on port 5555.
Unplug the cable, then run adb connect 192.168.1.42:5555, using the device's actual IP address.
The connection drops if the phone changes Wi-Fi networks, or sits idle long enough for the router to release its lease.
Port Forwarding with adb forward and adb reverse
adb forward: routes traffic from a computer port to a port on the device. adb forward tcp:8080 tcp:8080 is a common example.
adb reverse: works the other direction, exposing a computer's local server to the device. adb reverse tcp:8081 tcp:8081 is exactly what a React Native Metro bundler needs to reach a physical phone.
Chrome's own remote inspector, and most JavaScript debug servers, depend on this same forwarding trick to bridge TCP/IP between two machines with no direct route to each other.
ADB Input and Screen Control Commands
Input commands simulate the taps, swipes, and key presses a human would normally provide by hand.
Appium holds roughly 4.61% of the testing and QA tool market, with more than 9,865 companies using it worldwide, according to 6sense data reported by TestDino.
Automated testing captured 46.05% of the mobile app testing approach in 2025, per Mordor Intelligence, a share that keeps growing as manual tap-and-check sessions get replaced by scripts.
These fall under the same types of software testing that rely on ADB's input layer under the hood, whether the script was written by hand or generated by a framework.
|
Command |
Simulates |
Example |
|---|---|---|
|
|
A single tap at coordinates |
|
|
|
A drag or scroll gesture |
|
|
|
A hardware key press |
|
|
|
Typed text into a focused field |
|
Simulating Touch and Key Input
Appium's Android driver builds most of its tap, swipe, and text-entry actions directly on top of these same input commands.
adb shell input keyevent KEYCODE_HOME sends the device back to the home screen instantly.
For randomized stress testing, adb shell monkey -p com.example.app 500 fires 500 random events at a single app, useful for surfacing crashes no scripted test would think to try.
Capturing Screenshots and Screen Recordings
A single screenshot pulls with adb shell screencap -p /sdcard/screen.png, then a follow-up adb pull grabs the file.
Screen recording works the same way in two steps: adb shell screenrecord /sdcard/demo.mp4 records, and adb pull retrieves the finished video.
Recording length caps out at three minutes per file by default, worth knowing before capturing a longer bug reproduction.
ADB Backup and Restore Commands
Backup commands create or restore a snapshot of app data directly through ADB, bypassing Google's cloud backup system entirely.
adb backup -apk -all -f backup.ab bundles every installed app's data, plus the APKs themselves, into a single file.
adb restore backup.ab reverses the process, feeding that same file back onto a device.
Android's own developer documentation caps Auto Backup at 25MB of data per app, refreshed roughly once a day whenever the device is idle and connected to Wi-Fi.
For apps targeting Android 12 (API level 31) and higher, setting allowBackup to false blocks cloud backup, but on some manufacturers' devices it does not stop device-to-device transfer, a distinction Google's own documentation calls out directly.
Password managers and banking apps commonly set allowBackup to false for exactly this reason, keeping credentials from ever leaving the device through Android's backup system.
bmgr is the modern command-line interface for backup management, and it now handles most of what adb backup used to do, since the older command runs into more restrictions on newer Android versions.
Common ADB Errors and How to Fix Them
Most ADB problems trace back to one of a handful of root causes, not a mysterious new bug every time.
|
Error Message |
Likely Cause |
Fix |
|---|---|---|
|
device unauthorized |
RSA prompt never approved on phone |
Reconnect, tap Allow on the device screen |
|
device not found |
Bad cable, missing driver, or udev rule |
Swap cable, reinstall USB driver, restart adb |
|
adb server version doesn't match this client |
Old server process still running |
|
|
more than one device/emulator |
Multiple devices connected at once |
Target one with |
device unauthorized almost always means the RSA key popup was dismissed, ignored, or never appeared because the screen was locked when the cable went in.
device not found on Windows usually points to a missing OEM USB driver, while the same error on Linux often traces back to outdated udev rules.
The version mismatch error tends to show up right after updating Android Studio or the SDK, since the bundled adb binary can silently outpace whatever server process is still running in the background.
When multiple devices or emulators are connected, every command needs a -s flag with the specific serial number, or ADB has no way to know which one you mean.
FAQ on ADB
What Is ADB Used For?
Android Debug Bridge lets developers install apps, pull logs, and run shell commands on a connected device.
It sits among the core mobile app development tools every Android engineer keeps close.
Most testing, debugging, and file transfer work runs through it.
How Do I Install ADB on My Computer?
Download the Android SDK Platform-Tools package for Windows, Mac, or Linux.
Add the folder to your system PATH, then run adb --version to confirm the install worked.
Android Studio installs this tool automatically if the IDE is already on your machine.
Why Does ADB Show My Device as Unauthorized?
This happens when the RSA key prompt on the phone was never approved, or got dismissed by accident.
Unplug the device, reconnect it, and watch the phone screen for the authorization popup.
Tapping Allow fixes it immediately.
Why Is My Device Not Found by ADB?
A charge-only USB cable is the most common cause of this.
Missing USB drivers on Windows, or outdated udev rules on Linux, also block detection entirely.
Confirm USB debugging is enabled in developer options, then reconnect the cable.
How Do I Fix "adb server version doesn't match this client"?
This error means an old adb server process is still running in the background.
Run adb kill-server, then adb start-server to restart the connection cleanly.
The mismatch usually follows an Android Studio or SDK update.
Can I Use ADB Without a USB Cable?
Yes, through wireless debugging.
Run adb tcpip 5555 over an existing USB connection first.
Then use adb connect with the device's IP address once it switches to network mode. The cable becomes optional after that first pairing.
Does ADB Work With the Android Emulator?
Yes. adb devices lists a running emulator the same way it lists a physical phone, usually as emulator-5554.
Anyone testing through the Android Studio emulator can run every install, shell, and file transfer command on it exactly like real hardware.
How Do I Install or Uninstall an App Using ADB?
adb install path/to/app.apk pushes a build straight onto the device.
adb uninstall com.example.app removes it by package name.
Add -r to reinstall over existing data. Both skip the Play Store entirely, which is why QA teams rely on them daily.
What Is the Difference Between ADB and Fastboot?
ADB only works while Android itself is booted and running.
Fastboot takes over once a device sits in bootloader mode, used for flashing partitions or unlocking the bootloader.
They solve different problems and rarely overlap.
Do I Need a Rooted Device to Use ADB?
No. Most commands, including adb install, adb pull, and adb shell, work fine on a stock, non-rooted device.
Root access only becomes necessary for reaching protected system paths, or removing certain system apps outright.