Install the ADB driver on the Android Ubuntu Platform

Source: Internet
Author: User

 

1. Ensure that the device is connected properly

First, you need to obtain the root permission. Use the lsusb command to list all USB devices, as shown in:

Here we can clearly see that there is a device with an ID number of 1782: 5d04. If there are many USB devices connected to your system, you cannot see clearly at the moment, you can unplug the device and compare it with the ID number, make sure that this ID is found.

This ID is followed by the vendor ID and the product ID. The vendor ID is unique. For example, if htc is 0x0bb4, Samsung is 0x04e8, Qualcomm is 0x05c6, and Huawei is 0x12d1. The 0x1782 we see here is the ID of Zhan Xun's vendor.

 

2. Create a configuration file under/etc/udev/rules. d/or add it to an existing configuration file.

This configuration file will be queried during device connection, such as 51-android.rules.

The Edit content is as follows:



 

Also, sometimes we will see SYSFS {High Tech Computer Corp .} this parameter is also the meaning of the device manufacturer. It seems that the previous official statement was written in this way. It was originally because HTC helped Google with its mobile phone, so in the first case, we wrote "High Tech Computer Corp. ", but now the official example has been changed to ATTR (idVendor.

 

3. Set permissions for this file

Chmod a + r/etc/udev/rules. d/51-android.rules

 

4. Restart udev

/Etc/init. d/udev restart

 

5. Add the adb_usb.ini file.

In ~ /. Add an adb_usb.ini file to the android directory. The path here is actually the root directory of each user. If you need to switch users, remember to add this stuff to each user.

Write the vendor ID in the adb_usb.ini file. The difference is that the prefix of 0x needs to be written here. For example, if my phone number is 0x1782

I have searched a lot of materials on the Internet. I did not mention some materials in this step. It is estimated that they did not use this step, but I did not succeed in my personal life and death until I added this file, it takes quite a while.

 

6. Restart adb.

Adb kill-server

Adb start-server

Adb devices

Now you can see the device. Now you can use adb normally.




Also, sometimes we will see SYSFS {High Tech Computer Corp .} this parameter is also the meaning of the device manufacturer. It seems that the previous official statement was written in this way. It was originally because HTC helped Google with its mobile phone, so in the first case, we wrote "High Tech Computer Corp. ", but now the official example has been changed to ATTR (idVendor.

 

3. Set permissions for this file

Chmod a + r/etc/udev/rules. d/51-android.rules

 

4. Restart udev

/Etc/init. d/udev restart

 

5. Add the adb_usb.ini file.

In ~ /. Add an adb_usb.ini file to the android directory. The path here is actually the root directory of each user. If you need to switch users, remember to add this stuff to each user.

Write the vendor ID in the adb_usb.ini file. The difference is that the prefix of 0x needs to be written here. For example, if my phone number is 0x1782

I have searched a lot of materials on the Internet. I did not mention some materials in this step. It is estimated that they did not use this step, but I did not succeed in my personal life and death until I added this file, it takes quite a while.

 

6. Restart adb.

Adb kill-server

Adb start-server

Adb devices

Now you can see the device. Now you can use adb normally.

SUBSYSTEM = usb, ACTION = add, ATTR {idVendor} = 0bb4, MODE = 0666, OWNER = k

Here we will explain these options,

The SUBSYSTEM identifies a USB device,

ATTR (idVendor) r describes the vendor's ID number,

MODE describes access permissions.

GROUP is described as plug-and-play, but it is of little use here and can be used without writing.

The OWNER item is used to specify which user has the operation permission. If this item is not written, it is root (not all users can access it). Note that sometimes some colleagues will be stuck here. If you use the root permission, this is omitted.

 

Also, sometimes we will see SYSFS {High Tech Computer Corp .} this parameter is also the meaning of the device manufacturer. It seems that the previous official statement was written in this way. It was originally because HTC helped Google with its mobile phone, so in the first case, we wrote "High Tech Computer Corp. ", but now the official example has been changed to ATTR (idVendor.

 

3. Set permissions for this file

Chmod a + r/etc/udev/rules. d/51-android.rules

 

4. Restart udev

/Etc/init. d/udev restart

 

5. Add the adb_usb.ini file.

In ~ /. Add an adb_usb.ini file to the android directory. The path here is actually the root directory of each user. If you need to switch users, remember to add this stuff to each user.

Write the vendor ID in the adb_usb.ini file. The difference is that you need to write the 0x prefix here. For example, if your htc mobile phone is set to 0x0bb4

I have searched a lot of materials on the Internet. I did not mention some materials in this step. It is estimated that they did not use this step, but I did not succeed in my personal life and death until I added this file, it takes quite a while.

 

6. Restart adb.

Adb kill-server

Adb start-server

Adb devices

Now you can see the device. Now you can use adb normally.

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.