1, Log in as root and create this file: /etc/udev/rules.d/51-android.rules.
2, copy 下面的内容到上面新建的文件:
UBSYSTEM=="usb", ATTR{"9025"}=="18d1", MODE="0666", GROUP="plugdev"
注:9025--vendorID
18d1--应该是usb设备id
The MODE=0666,assignment specifies read/write permissions, and GROUP defineswhich Unix group owns the device node.
id信息从lsusb中获取。下面是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 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 004: ID 18d1:9025 Google Inc.
Bus 003 Device 003: ID 0483:2016 SGS Thomson Microelectronics Fingerprint Reader
Bus 005 Device 002: ID 09da:000a A4 Tech Co., Ltd Port Mouse
Bus 006 Device 002: ID 17ef:1003 Lenovo Integrated Smart Card Reader
3, 重启udev
sudo service udev restart
4,重启 adb server。需要用root启动。
4.1 ./adb kill-server
4.2 sudo ./adb start-server
4.3 ./adb devices