近段时间需要由MTK平台转到Qcom平台开发,发现执行adb devices 命令,显示找不到设备,最后通过强大的度娘成功地解决问题,解决方案如下:
1) 在终端运行 lsusb,找到设备ID
结果显示:
hwruanjian@hwruanjian-Name:~$ lsusb
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:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 003: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 010: ID 271d:9015
2、注册到udev的rules文件
vim /etc/udev/rules.d/51-android.rules
添加这个ID:1ebf,如下:
SUBSYSTEM=="usb", ATTR{idVendor}=="<span style="color: rgb(51, 51, 51); line-height: 24px; font-family: Arial; ">271d</span>", MODE="0666"
保存文件并运行:
sudo chmod a+rx /etc/udev/rules.d/51-android.rules
sudo /etc/init.d/udev restart
运行结果如下:
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service udev restart
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) and then start(8) utilities,
e.g. stop udev ; start udev. The restart(8) utility is also available.
udev stop/waiting
udev start/running, process 14636
3、启动adb的服务
cd ~/tools/android-sdk-linux_x86/platform-tools
sudo ./adb kill-server
sudo ./adb start-server
一般情况,到此就可以直接用 adb 来进行操作了。然而,以上方法还不管用(本人情况),则执行以下操作:
1)使用lsusb查找到devID