Configure a USB connection in Linux (Android phone debugging)

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.