The adb we talked about is a general term, and there are two tools-Fastboot and ADB
Fastboot: means fast boot.
In Android phones, fastboot is a lower-level flashing mode than recovery. It is a flashing mode that connects the phone with a USB data cable. Compared with card swiping in some systems (such as ios), wire swiping is more reliable and safer. The use of fastboot on the PC requires the corresponding fastboot tool. We usually use the tool to flash the Recovery image, which is actually implemented by the fastboot tool.
ADB: The full name of ADB is Android Debug Bridge, which is a debugging bridge, which is convenient for debugging devices or developing Android APP. ADB is a tool in the android sdk, with this tool you can directly operate and manage the android emulator or real android device.
sudo apt install android-tools-adb
To use adb, you need to configure the environment, otherwise you will not have permission.
The configuration must first know the ID of the corresponding device.
$ lsusb
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse
Bus 003 Device 002: ID 413c:2107 Dell Computer Corp.
Bus 003 Device 014: ID 057b:901d Android, Inc.
Bus 003 Device 015: ID 05ac:12a8 Apple, Inc. iPhone5/5C/5S/6
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
The current concern is Android.
Create the file 70-android.rules under /etc/udev/rules.d/:
sudo vim /etc/udev/rules.d/70-android.rules
Add the following content to the file:
SUBSYSTEM=="usb", ATTRS{idVendor}=="057b", ATTRS{idProduct}=="901d", MODE="0666"
The content in ATTRS{idVendor} and ATTRS{idProduct} is the ID obtained by lsusb.
Restart the adb service:
sudo adb kill-server
sudo adb start-server
adb devices
Then you can debug directly.
adb shell
Recommended Posts