Common adb Commands

What is adb

Android Debug Bridge (adb) is a general-purpose command line tool that allows you to communicate with an emulator instance or a connected Android device. It facilitates various device operations, such as installing and debugging applications, and provides access to a Unix shell that can be used to run various commands on the emulator or connected device. The tool operates as a client-server program and consists of three components:

  • Client, this component sends commands. The client runs on the development computer. You can invoke the client from the command line terminal by issuing the adb command.
  • Background program, this component runs commands on the device. The daemon runs as a background process on each emulator or device instance.
  • Server, this component manages communication between clients and background programs. The server runs as a background process on the development computer.

From official documentation: https://developer.android.com/studio/command-line/adb.html

Official adb tool download

https://developer.android.com/studio/releases/platform-tools.html

Commonly used adb commands

Under normal boot conditions

Enter fastboot mode

Terminal window
adb reboot bootloader

Enter recovery mode

Terminal window
adb reboot recovery

Install software

Terminal window
adb install -r xxxx.apk

In fastboot mode

Check if the device is connected

fastboot devices

flash recovery

fastboot flash recovery xxxxx.img

Reboot to recovery

fastboot boot xxxx.img

adbsideload mode

Terminal window
adb sideload xxxxx.zip

Third party recovery

https://twrp.me/Devices/

Problems encountered in windows

If the adb server cannot start, it is usually due to the computer’s xxx Mobile Assistant occupying the port. Generally, you can end the corresponding process in the process manager.