[Android 调试] 解决linux系统不识别设备、手机问题方法

 

最近在开发过程中linux不识别开发板设备、手机,看了下dev guide,现在把方法提供给大家。
1 If you're developing on Ubuntu Linux, you need to add a udev rules file that contains a USB configuration for each type of deviceyou want to use for development. In the rules file, each device manufactureris identified by a unique vendor ID, as specified by theATTR{idVendor} property. For a list of vendor IDs, see  USB Vendor IDs, below. To set up device detection onUbuntu Linux:        Log in as root and create this file:            /etc/udev/rules.d/51-android.rules.            Use this format to add each vendor to the file:
              SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"

首先你打开 sudo gvim /etc/udev/rules.d/51-android.rules
           其中添加  SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666",我把group给删掉了,这个无所谓,反正电脑都是自己用。其中 ATTR{idVendor}=="0bb4"这个值是多少呢?
官网提供了这几种:
USB Vendor IDsThis table provides a reference to the vendor IDs needed in order to add USBdevice support on Linux. The USB Vendor ID is the value given to theATTR{idVendor} property in the rules file, as described above.
 
Company USB Vendor ID
Acer 0502
ASUS 0B05
Dell 413C
Foxconn 0489
Garmin-Asus 091E
Google 18D1
HTC 0BB4
Huawei 12D1
K-Touch 24E3
KT Tech 2116
Kyocera 0482
Lenevo 17EF
LG 1004
Motorola 22B8
NEC 0409
Nook 2080
Nvidia 0955
OTGV 2257
Pantech 10A9
Pegatron 1D4D
Philips 0471
PMC-Sierra 04DA
Qualcomm 05C6
SK Telesys 1F53
Samsung 04E8
Sharp 04DD
Sony Ericsson 0FCE
Toshiba 0930
ZTE 19D2

我怎么指导我的终端对应的是那个id呢?我买的也是moto的,但是写了moto的id还是不行,于是我用
命令:lsusb
会出现:
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 192f:0416 Avago Technologies, Pte.
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 0489:c001 Foxconn / Hon Hai
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

其中
Bus 001 Device 002: ID 0489:c001 Foxconn / Hon Hai
这个就是我的设备,对应上边的表,我找到id为0489,填到刚才打开的sudo gvim /etc/udev/rules.d/51-android.rules,这个文件中,
接下再执行命令:chmod a+r /etc/udev/rules.d/51-android.rule

ok,重启电脑即可。

   来自:eoeAndroid

你可能感兴趣的:(Android)