Vmware中使用Ubuntu不识别小米手机的解决办法【转】

今天想连小米手机测试下公司的程序,可是eclipse 的 Devices里面显示的是unknow设备,哎哟,竟然无法识别。

解决方法:

用数据线链接设备后,输入:lsusb,可以看到类似输出:

liyoro@liyoro-Ideapad-V460:~/文档/android-sdks/platform-tools$

lsusbBus 002 Device 013: ID 1c4f:0003 SiGma Micro HID controller

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub

Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub

Bus 001 Device 008: ID 0489:e00d Foxconn / Hon Hai

Bus 001 Device 004: ID 1c7a:0801 LighTuning Technology Inc.

Bus 001 Device 005: ID 04f2:b18a Chicony Electronics Co., Ltd

Bus 001 Device 010: ID 18d1:9025 Google Inc.

拔掉手机的USB连接线,再输入:lsusb:

liyoro@liyoro-Ideapad-V460:~/文档/android-sdks/platform-tools$ lsusb

Bus 002 Device 013: ID 1c4f:0003 SiGma Micro HID controller

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub

Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub

Bus 001 Device 008: ID 0489:e00d Foxconn / Hon Hai

Bus 001 Device 004: ID 1c7a:0801 LighTuning Technology Inc.

Bus 001 Device 005: ID 04f2:b18a Chicony Electronics Co., Ltd

对比发现Bus 001 Device 010: ID 18d1:9025 Google Inc.就是小米手机的。

然后:

sudo gedit  /etc/udev/rules.d/53-android.rules在打开的文件中增加以下文本:

SUBSYSTEM==”usb”, SYSFS{idVendor}==”04e8″, MODE=”0666″

SUBSYSTEM==”usb”, ATTR{idVendor}==”04e8″, ATTR{idProduct}==”685e”, SYMLINK+=”android_adb”

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

sudo /etc/init.d/udev restart

接着:

切换到android sdk的platform-tools目录下(这一步很重要,必须要sudo,否则没效果)

sudo ./adb devices (这个主要是查看下已连接上的android机器)

List of devices attached

???????????? no permission(这个是小米手机,尚未识别)

semulator-5554 device(~。~我开了个android模拟器)

以下命令是:重启adb服务,再输入adb devices就应该能找到设备了。

sudo ./adb kill-server

sudo ./adb devices

终端输出:

* daemon not running. starting it now on port 5037 *

* daemon started successfully*

List of devices attached

emulator-5554 device

0237036b device(这个就是小米手机了)

看到终端里面有以上输出,就说明设备识别成功了。在eclipse的Devices里面可以看到了。

完!

 

原文地址http://liyoro.blog.com/?p=26

发表评论

电子邮件地址不会被公开。 必填项已用*标注

This site uses Akismet to reduce spam. Learn how your comment data is processed.