您的位置:首页 > 运维架构 > Linux

解决linux下识别android设备

2012-03-17 12:19 260 查看
文章转自http://www.eoeandroid.com/thread-97599-1-1.html

近在开发过程中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.

CompanyUSB Vendor ID
Acer0502
ASUS0B05
Dell413C
Foxconn0489
Garmin-Asus091E
Google18D1
HTC0BB4
Huawei12D1
K-Touch24E3
KT Tech2116
Kyocera0482
Lenevo17EF
LG1004
Motorola22B8
NEC0409
Nook2080
Nvidia0955
OTGV2257
Pantech10A9
Pegatron1D4D
Philips0471
PMC-Sierra04DA
Qualcomm05C6
SK Telesys1F53
Samsung04E8
Sharp04DD
Sony Ericsson0FCE
Toshiba0930
ZTE19D2
我怎么指导我的终端对应的是那个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,重启电脑即可。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: