1.现象描述
- lsusb可以看到设备已经连接,但adb devices时没有list到设备
# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 017: ID 0b95:772b ASIX Electronics Corp. AX88772B
Bus 001 Device 022: ID 18d1:4e26 Google Inc.//usb已经识别
Bus 001 Device 016: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 002: ID 413c:2113 Dell Computer Corp.
Bus 001 Device 015: ID 413c:301a Dell Computer Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
# adb devices
List of devices attached
2.修改方法
- 在 /etc/udev/rules.d/下面新建70-Android.rules文件,并添加对应设备的pid/uid
# cat /etc/udev/rules.d/70-android.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1",ATTRS{idProduct}=="4e26",MODE="0666"
- 给70-android.rules加权限
# sudo chmod a+rx /etc/udev/rules.d/70-android.rules
- 重启 udev服务
# sudo service udev restart
- 重启adb服务
# sudo adb kill-server
# sudo adb devices
List of devices attached
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
d41d8cd98f00b204 device
- 上述步骤如果仍然没有显示设备,进行如下操作
# echo "0x18d1" > ~/.android/adb_usb.ini
- 手机断开,重新连接即可