USB连接到ubuntu主机设备名出现乱码

来源:互联网 发布:四川广电网络招聘 编辑:程序博客网 时间:2024/06/05 01:16

android5.1机器连接到ubuntu服务器上面,adb devices 出现乱码,如下:
lb@sam :~GMS$ adb devices

   List of devices attached  ???????? no permissions

lb@sam :~/GMS$
解决方法如下:

1、参考:http://peirenlei.iteye.com/blog/1564686

lb@sam :~$ lsusbBus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching HubBus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching HubBus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hubBus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hubBus 001 Device 003: ID 046b:ff10 American Megatrends, Inc.Bus 002 Device 008: ID 2207:0011 lb@sam :~$lb@sam :~$lb@sam:~$lb@sam:~$ lsusbBus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching HubBus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching HubBus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hubBus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hubBus 001 Device 003: ID 046b:ff10 American Megatrends, Inc.

2、找出机器对应的Devices
列表中,Bus 002 Device 008: ID 2207:0011,这一行为android机器的usb使用端口,记录一下,
id为2207据网上的资料说,现在使用Android系统的手机越来越多,每款手机都分配了idVendor,解决方法都一样

3、sudo vim /etc/udev/rules.d/70-persistent-cd.rules
加入以下内容
SUBSYSTEM==”usb”, ATTRS{idVendor}==”2207”, ATTRS{idProduct}==”0011”, MODE=”0666”
其中的idvendor idProduct指的是USB的ID可以使用lsusb查询得到。
Bus 002 Device 008: ID 2207:0011
ID 2207 就是idVendor 0011就是idProduct

$sudo chmod a+rx /etc/udev/rules.d/70-persistent-cd.rules$sudo service udev restart

5、不需要重启计算机,重新启动adb server下就ok
(很重要)拔掉usb重新连上再执行:

adb kill-serveradb devicesadb root (这一步很重要 )