After connecting to the Android device via USB, you can use the ADB command to interact with the device. You need to configure the device in Linux and do not need to install the driver, because the USB device is not authorized in Linux, the configuration method is as follows:
1. After connecting the USB device, run the lsusb command to view the vendorid and productid of the device.
As follows:
Bus 003 device 001: Id 1d6b: 0003 Linux Foundation 3.0 root hubbus 002 device 006: Id 04e8: 689e Samsung Electronics Co ., ltd bus 002 device 003: Id 046d: c52f Logitech, Inc. wireless mouse m305bus 002 device 002: Id 8087: 0024 Intel Corp. integrated Rate Matching hubbus 002 device 001: Id 1d6b: 0002 Linux Foundation 2.0 root hubbus 001 device 006: Id 0489: e033 Foxconn/Hon Hai bus 001 device 003: Id 064e: d20c Suyin Corp. bus 001 device 002: Id 8087: 0024 Intel Corp. integrated Rate Matching hubbus 001 device 001: Id 1d6b: 0002 Linux Foundation 2.0 root Hub
Here, the vendorid and productid of the mobile phone are 04e8 and 689e, respectively. Samsung identifies the mobile phone as a Samsung machine.
2. in/etc/udev/rules. d/create a rule file 51-android.rules under the directory. The file will be automatically loaded after the system starts. The file contains the vendorid and productid obtained in the previous step, as shown below:CodeAs shown in:
Subsystems = "USB", attrs {idvendor = "04e8", attrs {idproduct }== "689e", mode = "0666", owner = "huangbiao "}
The owner here refers to the current Linux user name.
3. Restart the USB service by running the following command:
Sudo/etc/init. d/udev restart