About ADB's Android Debug Bridge (Android Debug Bridge)

  • 2021-11-13 18:14:06
  • OfStack

1. Functions of ADB:

ADB is the abbreviation of Android Debug Bridge (Android Debug Bridge), which is used to control the operation of mobile phones through computer code scripts (or computer programs, etc.).

2. ADB installed or not:

To determine whether ADB has been installed successfully (here, successful installation includes configuring "environment variable"), just press win+R, enter cmd, enter adb version command in the pop-up command window and enter. If ADB is installed successfully, version information will be printed.

3. Judge other environmental problems:

Due to various reasons (including that the data cable is actually a charging cable, and the USB interface has poor contact due to dust accumulation, etc.), the mobile phone cannot actually link with ADB. To judge whether ADB can connect with the mobile phone, enter adb devices command in cmd command window and enter. If the link is successful, the following contents will be printed:

List of devices attached (several devices are linked, and a few lines appear below)
cw93hr2 device
e83zz93 device
ae3r1h0 device

4. Install ADB:

@ 1-If you have Android Studio, you will be reminded of some problems with installing ADB and virtual machines during installation. 1 In general, Android Studio installs ADB in its platform-tools folder under SDK, finds it and adds it to the environment variable.

@ 2-If you don't have Android Studio (1 is generally used for APP development), you can download one. Or if you want to use ADB alone, you can go to Android official website (this website sometimes needs to climb over the wall) to download Android platform-tools, unzip it after downloading, and add this folder to the environment variable.

@ 3-If you don't have wall-climbing software, please click this link to download Android platform-tools (version number 29.0. 4) which I downloaded from Android official website in October 2019.

5. Using ADB:

There are many instructions about the use of ADB, including screenshots, clicking, sliding, home key, return key, on/off and so on.

These instructions can be executed in cmd as a system instruction after adding environment variables, or called using packages such as os, which begins with adb, for example:

adb shell input keyevent 4 (4 for return key) See other keys for numbers

adb shell input tap 500 500 (Click on the point on the screen with coordinates 500, 500)

adb shell swipe 200 200 300 300 (Slide screen from point of coordinates 200, 200 to point of coordinates 300, 300)

adb shell screencap-p/sdcard/autojump. png (screenshot, used with the following sentence 1)

adb pull/sdcard/01. png (and download to a locally specified file, used with 1 above)

Summarize


Related articles: