ubuntu 14.04环境下执行adb shell 时报错 error: device not found.的解决方法

来源:互联网 发布:数控编程东方明珠图 编辑:程序博客网 时间:2024/04/28 05:28
解决方法:

1.先在不接入android设备的情况下,使用lsusb 查看usb设备,然后在接入android设备的情况下,使用lsusb 查看usb设备,如下红色部分对应的就是android设备

(1)不接入android设备的情况
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 001 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 004: ID 0bda:0184 Realtek Semiconductor Corp. RTS5182 Card Reader
Bus 003 Device 003: ID 413c:2113 Dell Computer Corp.
Bus 003 Device 002: ID 24ae:2002  
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

(2)入android设备的情况
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 001 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 004: ID 0bda:0184 Realtek Semiconductor Corp. RTS5182 Card Reader
Bus 003 Device 008: ID 1f3a:1007 Onda (unverified)
Bus 003 Device 003: ID 413c:2113 Dell Computer Corp.
Bus 003 Device 002: ID 24ae:2002  
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

2.创建adb_usb.ini文件,写入id:0x1f3a

在home下寻找.android目录,在此目录下新建一个文件adb_usb.ini.

echo0x1f3a> ~/.android/adb_usb.ini

3.添加权限

sudo gedit /etc/udev/rules.d/51-android.rules

加入以下内容,注意红色部分对应的就是lsusb得到的id

SUBSYSTEM=="usb", ATTRS{idVendor}=="1f3a", ATTRS{idProduct}=="1007",MODE="0666"

4.重启USB服务

$sudo chmod a+rx /etc/udev/rules.d/51-android.rules
$sudo service udev restart

5.重启adb服务,adb devices有设备说明adb安装成功

$adb kill-server

$sudo adb start-server

$adb devices

List of devices attached
86449a88572700000000 device
阅读全文
1 0