解决linux下识别android设备


文章转自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,重启电脑即可。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值