Android Debug Bridge

Tool for debugging Android-based devices
title: "Android Debug Bridge" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["android-(operating-system)", "android-(operating-system)-development-software", "debugging", "communications-protocols", "free-software-programmed-in-c++", "software-using-the-apache-license"] description: "Tool for debugging Android-based devices" topic_path: "technology/software-engineering" source: "https://en.wikipedia.org/wiki/Android_Debug_Bridge" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0
::summary Tool for debugging Android-based devices ::
::data[format=table title="Infobox software"]
| Field | Value |
|---|---|
| title | Android Debug Bridge |
| logo | Android Robot Head 2023.svg |
| logo size | 100px |
| collapsible | |
| screenshot | Adb on Command Prompt.png |
| caption | Starting the adb server in Command Prompt, which then enumerates the devices. After that, a shell is opened on the device being debugged to run the uname command. |
| author | |
| released | |
| ver layout | |
| discontinued | |
| latest release version | 34.0.1 (March 2023) |
| latest release date | |
| latest preview date | |
| repo | android.googlesource.com |
| programming language | C++ |
| engine | |
| operating system | Windows, Linux, macOS |
| included with | Android SDK |
| language count | |
| genre | Software development tool |
| license | Apache License 2.0 |
| website | |
| :: |
| title = Android Debug Bridge | name = | logo = Android Robot Head 2023.svg | logo caption = | logo alt = | logo size = 100px | collapsible = | screenshot = Adb on Command Prompt.png | screenshot size = | screenshot alt = | caption = Starting the adb server in Command Prompt, which then enumerates the devices. After that, a shell is opened on the device being debugged to run the uname command. | other_names = | author = Google | developer = | released = | ver layout = | discontinued = | latest release version = 34.0.1 (March 2023) | latest release date = | latest preview version = | latest preview date = | repo = android.googlesource.com | qid = | programming language = C++ | middleware = | engine = | operating system = Windows, Linux, macOS | platform = | included with = Android SDK | replaces = | replaced_by = | service_name = | size = | standard = | language = | language count = | language footnote = | genre = Software development tool | license = Apache License 2.0 | website = | AsOf =
The Android Debug Bridge (commonly abbreviated as adb) is a programming tool used for the debugging of Android-based devices. The daemon on the Android device connects with the server on the host PC over USB or TCP, which connects to the client that is used by the end-user over TCP. Made available as open-source software under the Apache License by Google since 2007, its features include a shell and the possibility to make backups. The adb software is available for Windows, Linux and macOS. It has been misused by botnets and other malware, for which mitigations were developed such as RSA authentication and device whitelisting.
Features
::figure[src="https://upload.wikimedia.org/wikipedia/commons/c/cf/Android_Device_Monitor.png" caption="Android Device Monitor"] ::
Features of adb include copying files from the host computer, installing apps, viewing logcat output, getting a Unix shell, and rebooting into Qualcomm EDL mode. For example, Android applications can be saved by the command [backup](backup) to a file. It also includes support for the Java Debug Wire Protocol.
Some graphical interfaces have been made available. The graphical Android Device Monitor in Android Studio can be used for retrieving information from an Android device.
Android's method to install APK files on a device has been used as a way to sideload unofficial apps onto Windows Subsystem for Android and Chrome OS's Android virtual machine.
Shizuku allows an Android phone to connect to its own ADB when connected to a wireless network. The application is available for free on the Google Play Store.
Development history
The Android Software Development Kit (SDK) was first released in 2007. Since 2017, Google made it possible to download adb separately from the Android SDK.
In 2015, Microsoft released an Android emulator that can connect to the adb client. In 2016 for Android Studio 2.0 a 5x performance improvement was made for installing apps and pushing files through adb. For easier usage of Android Things, a wrapper was made in 2017 around manual adb commands. For Android 11 in 2020, Google added adb incremental installations. In 2020, Wi-Fi adb was integrated into Android Studio for macOS. In 2021 for Android 12, the adb backup command was limited so that backing up user data from apps is opt-in using a per-app manifesto configuration after being deprecated in Android 10 along with adb restore. Fuchsia will be backwards-compatible with adb. It will be replaced with fx and ffx.
Setup
|title= |width=200 | height=350 |align=right |File:USB debugging prompt warning for Android 12 and up.png|For enabling USB debugging on the Android device, it needs to be enabled in the "developer settings" window |File:USB debugging prompt - RSA auth - Android 12 and up.png|After the device is connected to the host computer, the user needs to verify the RSA key fingerprint of the host computer
Host computer
For Windows, the Android SDK contains the adb.exe binary that can be extracted and installed. How-To Geek recommends adding the folder containing the binaries to the PATH environment variable.
On Ubuntu, adb can be installed with the android-tools-adb package. For Debian, it has been recommended to also install the android-sdk-platform-tools-common package next to the adb package, which installs the udev rules which makes it possible to run the tool without root permissions. For macOS and other Linux distributions, the platform tools can be downloaded and the PATH variable can be modified in bashrc.
Android device
In Android 4.2.2 or later (API level 17), a dialog is shown with an RSA fingerprint that the user needs to accept. This protects against computers exploiting the debugging mechanism without consent of the device user. Starting in Android 4.2, the developer settings are hidden by default. Pressing seven times on the build number in the about menu makes them visible to the user. After that, the USB debugging option can be enabled. Some Android vendors have different procedures to enable it. For example, Huawei requires entering a pincode before adb can be enabled.
If the touchscreen of an Android device is broken, it can be possible to connect a mouse to the device using USB On-The-Go and enable USB debugging.
Architecture
The adb protocol can be transported over USB or over Wi-Fi through TCP. It uses a client-server architecture. There are two different protocols in use. The first is between the client and the server and the second is between the server and the daemon. The adb daemon is implemented in C and located in the Android user space. The daemon is facilitated by the Android USB framework, UsbDeviceManager and UsbDebuggingManager.
Client ↔ server protocol
The communication mode between the client and server is a TCP socket. The server listens on a port, to which the client has to send a request. The request contains a 4-byte initial field in ASCII and a payload. The payload starts with the word host, to indicate it should be sent to the server. The server can then reply with OKAY or FAIL to indicate the status, combined with an optional payload and length.
Server ↔ daemon protocol
The messages sent from the server consist of a 24-byte long header, with the following fields:
- Command
- First argument
- Second argument
- Length of the payload, 0 or higher
- CRC-32 of the data payload
- Magic value, calculated through command XOR
0xFFFFFFFF
Security
Up to Android 2.2, Android was vulnerable to the RageAgainstTheCage exploit. The adb daemon did not check for the return value of the setuid system call when dropping privileges. The exploit forks processes until it fails due to the exhaustion of process identifiers. When the daemon crashes and restarts, it cannot start a new process with dropped privileges and keeps running as root. Then adb provided a root shell. In 2017, a security vulnerability was disclosed that exploited ADB to take over the onboard modem. The attack required adb to be already enabled and authorized, although some workarounds were available.
Various families of malware such as ADB.Miner, Ares, IPStorm, Fbot and Trinity have scanned the internet for public availability of the adb interface and installed malware on those devices. adb can also be used to remove malware, by booting into safe mode and running the adb uninstall command.
References
References
- Darcey, Lauren. (2012). "Android wireless application development". Addison-Wesley.
- "Things You Can Do with Android's adb Command".
- EASTTOM, CHUCK. (2021). "An In-Depth Guide to Mobile Device Forensics". CRC PRESS.
- Jack Wallen. (2015-03-06). "How to create a full backup of your Android device without root".
- Regupathy, Rajaram. (2014). "Unboxing Android USB: a hands-on approach with real World examples".
- (2016). "Learning embedded Android N programming: create the perfectly customized system by unleashing the power of Android OS on your embedded device".
- (23 January 2022). "How to sideload Android apps on Windows 11".
- (5 March 2023). "How to sideload apps to a Chromebook".
- "User manual {{!}} Shizuku".
- "Google releases Android SDK".
- (2017-01-05). "Google makes ADB, fastboot, and other platform tools available without full SDK or Android Studio download".
- Vasile, Cosmin. (29 July 2015). "Microsoft Releases Android Emulator and It's Supposed to Be Faster than Google's".
- "Android Studio 2.0 - Beta".
- "Android Things Developer Preview 6".
- "Turning it up to 11: Android 11 for developers".
- "Announcing Android Studio Arctic Fox (2020.3.1) & Android Gradle plugin 7.0".
- "Behavior changes: Apps targeting Android 12 {{!}} Android 12 Beta".
- "Google Considers Removing Android ADB Backup and Restore".
- Bradshaw, Kyle. (2022-08-26). "Google wants to make Fuchsia devices manageable with Android's ADB tool".
- Harwani, B. M.. (2013). "PhoneGap build: developing cross platform mobile applications in the cloud".
- (4 September 2021). "How to Install and Use ADB, the Android Debug Bridge Utility".
- Smyth, Neil. (2020). "Android Studio 4. 0 Development Essentials - Java Edition: Developing Android Apps Using Android Studio 4. 0, Java and Android Jetpack.".
- "Debian -- Details of package adb in bullseye".
- "How to Install Android Debug Bridge (ADB) and Fastboot".
- "Run apps on a hardware device".
- Wallen, Jack. "How to enable Developer options in Android 4.2".
- Ogubuike, Udochi. (2019-08-09). "How to enable USB debugging mode on Android".
- Aranzulla, Salvatore. "Come attivare debug USB".
- Drake, Joshua J.. (2014). "Android hacker's handbook". Wiley.
- Mendelsohn, Tom. (2017-01-09). "Google plugs severe Android vulnerability that exposed devices to spying".
- Cimpanu, Catalin. "Android devices ensnared in DDoS botnet".
- Schuman, Evan. "This Vultur app takes malicious to the next level". [[Computerworld]].
::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::