"Turn" Linux under the Android ADB driver installation detailed

Source: Internet
Author: User

Original URL: http://blog.csdn.net/zhenwenxian/article/details/5901350

Linux under the Android ADB driver installation detailed overview

Recently due to the number of built-in partners, I use the Ubuntu system a lot of manufacturers of Android phones can not be correctly identified, after a toss, and consult the SDK, now Linux under the ADB Drive configuration method and the related problems encountered in the solution to contribute to everyone.

Linux under the use of mobile phone USB debugging mode to connect ADB to the Android program debugging, configuration driver without windows to intuitive.

Specific steps

First confirm that the phone is connected to the computer, LSUSB check the device record.

[Email protected]:~$ lsusbbus 007 device 009:id 18d1:4e12bus 007 Device 001:id 1d6b:0002 Linux Foundation 2.0 root Hubbu s 006 Device 001:id 1d6b:0001 Linux Foundation 1.1 root hubbus 005 Device 001:id 1d6b:0001 Linux Foundation 1.1 root Hub Bus 003 Device 001:id 1d6b:0002 Linux Foundation 2.0 root hubbus 002 Device 001:id 1d6b:0001 Linux Foundation 1.1 root H Ubbus 001 Device 001:id 1d6b:0001 Linux Foundation 1.1 root hubbus 004 Device 004:id 093a:2510 Pixart Imaging, Inc.bus 0 Device 001:id 1d6b:0001 Linux Foundation 1.1 root Hub

I am here:

Bus 007 Device 009:id 18d1:4e12

Then create a configuration file under/etc/udev/rules.d/: 51-android.rules

sudo vim/etc/udev/rules.d/50-android.rules

The following configuration parameters are added to the file:

subsystem== "USB", sysfs{"high Tech computer Corp."} = = "0bb4", mode= "0666"

Save, set permissions under Configuration file

sudo chmod a+rx/etc/udev/rules.d/50-android.rules

Restart

Sudo/etc/init.d/udev restart

Finally restart the next ADB service, you can (do not configure the environment variable to go to the Android SDK tools directory to execute sudo./adb kill-server./ADB devices)

sudo adb kill-serversudo adb devices
Add

Sysfs Parameters:

sysfs{"Idvendor"}= "xxx"

The SYSFS parameter in the Linux adb driver configuration file refers to the device manufacturer. The original use case on the official website was "high Tech computer Corp" because HTC helped Google make the phone. But now moto, Sony Ericsson, Samsung and other mobile phone manufacturers to join, Android manufacturers have not only HTC a home. And what if the device model is not 0BB4?

When reading the SDK Help documentation, I found that the SDK has provided instructions:
(See: docs/guide/developing/device.html)

If You're developing on Ubuntu Linux and you need to add a rules file that contains a USB configuration for Each of the type of device you want to use for development. Each device manufacturer uses a different vendor ID. The example rules files below show how to add an entry for a single vendor ID (the HTC vendor ID). In order to support more devices, you'll need additional lines of the same format that provide a different value for the Sysfs{idvendor} property. For other IDs, see the table Of usb Vendor IDs, below.

1. Log in as root and create this file:/etc/udev/rules.d/51-android.rules.

For Gusty/hardy, edit the file to read: [Note: Ubuntu 7.10 and later]
subsystem== "USB", sysfs{idvendor}== "0bb4″, mode=" 0666 ″

For Dapper, edit the file to read: [Note: Ubuntu 6.06 and previous version]
subsystem== "Usb_device", sysfs{idvendor}== "0bb4″, MOD E= "0666″
2. Now execute:
chmod a+r/etc/udev/rules.d/51-android.rules

Just follow the instructions to modify the 0bb4 in the created 51-android.rules file to the appropriate USB vendor ID information.
Like my cell phone is motorola,idvender, it's 22b8.
So this line is

subsystem== "USB", sysfs{idvendor}== "22b8", mode= "0666"

However, you can write multiple lines to use a variety of devices. For example I wrote all of them, as follows:

#Acer 0502subsystem== "USB", sysfs{idvendor}== "0502", mode= "0666" #Dell 413csubsystem== "USB", sysfs{idvendor}== "413 C ", mode=" 0666 "#Foxconn 0489subsystem==" USB ", sysfs{idvendor}==" 0489 ", mode=" 0666 "#Garmin-asus 091esubsystem==" usb ", sysfs{idvendor}==" 091e ", mode=" 0666 "#HTC 0bb4subsystem==" USB ", sysfs{idvendor}==" 0bb4 ", mode=" 0666 "#Huawei 12d1 subsystem== "USB", sysfs{idvendor}== "12d1", mode= "0666" #Kyocera 0482subsystem== "USB", sysfs{idvendor}== "0482", MODE= "0666" #LG 1004subsystem== "USB", sysfs{idvendor}== "1004", mode= "0666" #Motorola 22b8subsystem== "USB", Sysfs{idvendor }== "22b8", mode= "0666" #Nvidia 0955subsystem== "USB", sysfs{idvendor}== "0955", mode= "0666" #Pantech 10a9subsystem== "u     SB ", sysfs{idvendor}==" 10a9 ", mode=" 0666 "#Samsung 04e8subsystem==" USB ", sysfs{idvendor}==" 04e8 ", mode=" 0666 "#Sharp 04ddsubsystem== "USB", sysfs{idvendor}== "04DD", mode= "0666" #Sony Ericsson 0fcesubsystem== "USB", sysfs{idvendor}== " 0fce ", mode=" 0666 "#ZTE 19d2subsystem== "USB", sysfs{idvendor}== "19d2", mode= "0666" 

But this above ID, does not include all, I have a device on the hand of the USB ID is not in the above list.
The workaround is that you can use the LSUSB command to view your USB ID

[Email protected]:~$ lsusbbus 002 Device 003:id 413c:2003 Dell computer Corp. Keyboardbus 002 Device 002:id 0461:4d22 Pr  Imax Electronics, Ltdbus 002 Device 001:id 1d6b:0001 Linux Foundation 1.1 root hubbus 001 Device 010:id 18a1:0002bus 001 Device 001:id 1d6b:0002 Linux Foundation 2.0 root Hub

Locate the ID 18a1 above and add the device to the file.

subsystem== "USB", sysfs{idvendor}== "18a1", mode= "0666"

Modify/etc/udev/rules.d/51-android.rules do not need to restart the Linux machine, Plug and unplug the device is ready. Run ADB devices again to see that your device is connected

[Email protected]:/opt/android/android-sdk-linux_86/tools$ sudo./adb deviceslist of Devices attached0403502001011000    Device

And before that, what you might see is

[Email protected]:/opt/android/android-sdk-linux_86/tools$ sudo./adb deviceslist of devices attached????????????    No permissions

"Turn" Linux under the Android ADB driver installation detailed

Related Article

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.