EMZETT.
Login

ADB (Android Debug Bridge)

In short: ADB is a command-line tool with which a computer controls an Android device via USB or Wi-Fi: install apps, copy files, read logs and run commands.

In more detail: ADB consists of three parts: the client (adb on the computer), a server (background process on the computer) and the adbd service on the device. Developers use it for testing and troubleshooting. It is part of the Android Platform Tools.

In Depth

Setting up:

  1. On the device: Settings → About phone → tap the build number several times to enable developer options.
  2. There switch on USB debugging.
  3. Connect via USB and confirm the fingerprint prompt (“Trust this computer?”).
  4. On the computer: download Platform Tools, adb devices shows the device.

Important commands:

adb devices                       # connected devices
adb install app.apk               # install an app
adb uninstall package.name        # remove an app
adb push file.txt /sdcard/        # file to the device
adb pull /sdcard/photo.jpg .      # fetch a file from the device
adb logcat                        # live system log
adb shell                         # console on the device
adb shell pm list packages        # installed packages
adb reboot bootloader             # restart into the bootloader
adb tcpip 5555 && adb connect IP  # over Wi-Fi
  • Fastboot: Second tool for bootloader mode: fastboot flashing unlock, fastboot flash. It writes system images. Unlocking wipes the data.
  • Wireless debugging: From Android 11 you pair without a cable via a code.
  • Security: USB debugging grants far-reaching access. Turn it off after work, trust only your own computers, never connect the device to foreign charging stations with debugging active. The authorization prompt on the device protects against that.
  • Related: Android Studio, emulators, network analysis via ADB.

See also: Bootloader, Drivers, Firmware