WINDOWS
关于adb devices无法找到设备有以下几种解决方案:
1、先adb kill-server,再adb start-server
2、出现如下问题
(1) netstat -aon|findstr "5037" 先查找5037端口被什么进程占用
(2) tasklist|findstr "2748" 2048指占用的进程PID
(3)taskkill /f /t /im 你的进程名
或者 ntsd -c q -p PID PID为进程号
或者在任务管理器中杀死该进程
3、终极解决方案(如果上面两种方式都无法解决),请进入C:\Users\ouyangxq\.android目录下是否缺少adb_usb.ini
如果缺少该文件,请拷贝一份到该目录下
Linux
以下是我的输出(当前连的是小米手机)
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 062a:0000 Creative Labs Optical mouse
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 413c:2105 Dell Computer Corp. Model L100 Keyboard
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 007: ID 18d1:9025 Google Inc.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 007: ID 18d1:9025 Google Inc.
(3) 创建rules文件
sudo vi /etc/udev/rules.d/51-android.rules
在末尾增加文件内容:
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="9025", MODE="0600"
(4)保存后给予权限:
sudo chmod a+rx /etc/udev/rules.d/51-android.rules
(5)sudo /etc/init.d/udev restart 或者 sudo restart udev
(6)sudo adb kill-server
(7)sudo adb start-server
(8)sudo adb devices