Please remember to add a category to the bottom of each page that you create.
See categories help for further details, but most will probably be [[Category:HTC ModelName]].

Android Debug Bridge

From XDA-Developers
Jump to: navigation, search

The Android Debug Bridge (ADB) is a software interface between an Android device and a host computer. It allows for the issuing of shell commands and the transfer of files.

Theory

There are three pieces of software involved: a daemon, a server and a client.

Adb.png

The daemon runs on the Android device. The server and client run on the host device and are packed into a single executable. The host software can be downloaded as part of the Android SDK.

Daemon

The ADB daemon, called abdb, runs on the Android device. It accesses the Android device and offers services over either a WiFi connection or a USB connection. The system property service.adb.tcp.port configures the port to which the daemon listens. The default is TCP port 5555. If no value is configured the daemon allows a connection over USB.

Server

The server part of the adb executable on the host connects to the daemon on the Android device over either WiFi or USB connection. The server can connect simultaneously to multiple Android devices or an emulator. The server accepts multiple TCP connections on port 5037 from any client on the host and provides access to the Android device.

Client

The client part of the adb executable on the host connects to the server part of the adb executable on the host. It provides user services.

Third party clients

Third party clients may be written that access ADB services. They may connect directly to the ADB server over a TCP connection or invoke an ADB client and communicate over a pipe. These could be GUI file managers or file system synchronizers.

Services

The ADB daemon provides access to many services:

  • Shell service
  • TCP port forwarding
  • Device stream forwarding
  • Echo service
  • Logcat service
  • JDWP debugging
  • Screen capture service
  • File transfer service
  • Backup service
  • Restore service
  • Disk mounter service
  • Reboot device

Usage

adb connect deviceConnects to an Android device over WiFi, where device is a defined host or an IP address
adb usbConnects to an Android device over a USB connection
adb shellBrings up an interactive command shell
adb push source destinationCopies a file from host to Android device
adb pull source destinationCopies a file from Android device to host
adb logcatStreams Android logcat (debugging log)
adb rebootReboots Android device

External links