不同手机用数据线与ubuntu连接后,执行adb devices,好多出现找不到devices的情况。
这里解决措施:
1. 执行lsusb(连接手机前与后)
找到显示内容的差异项:
root@localhost:/usr/lib/jvm# adb devices
List of devices attached
root@localhost:/usr/lib/jvm# lsusb
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 04f2:b302 Chicony Electronics Co., Ltd
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
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 002: ID 24ae:1100
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@localhost:/usr/lib/jvm# lsusb
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 04f2:b302 Chicony Electronics Co., Ltd
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
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 002: ID 24ae:1100
Bus 003 Device 010: ID 2717:ff40
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@localhost:/usr/lib/jvm#
2.其次 修改71-android.rules 这个配置文件 root@localhost:/etc/udev/rules.d# vim 71-android.rules
把上面的 2717 ff40 粘贴到 这个文件里面
也就是 这句话
UBSYSTEM=="usb", ATTR{idVendor}=="2717", ATTRS{idProduct}=="ff40", MODE="0666", GROUP="plugdev"
3. 进入文件夹 ~/.android ,找到文件:adb_usb.ini
打开次文件: vim adb_usb.ini
将2中填写的ATTR{idVendor}=="2717"中内容补充进入: 0x2717
root@localhost:/etc/udev/rules.d# cd ~/.android/ root@localhost:~/.android# ls adbkey adbkey.pub root@localhost:~/.android# touch adb_usb.ini root@localhost:~/.android# ls adbkey adbkey.pub adb_usb.ini root@localhost:~/.android# root@localhost:~/.android# chmod -R 777 adb_usb.ini root@localhost:~/.android# vim adb_usb.ini
保存退出。
4. service udev restart
5. adb kill-sever
adb start-server
当然了,手机一定要设置为调试模式