1、问题
今天在ubuntu下手机连接usb
shell终端,输入adb shell显示:
xcz$ adb shell
error: insufficient permissions for device
2、解决
输入lsusb命令,查看usb的ID号(红色部分):
xcz$ 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:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 003 Device 002: ID 413c:2106 Dell Computer Corp. Dell QuietKey Keyboard
Bus 003 Device 003: ID 04ca:0061 Lite-On Technology Corp.
Bus 003 Device 004: ID 05c6:9020 Qualcomm, Inc.
那么我们进入到cd /etc/udev/rules.d/下,新建一个51-android.rules文件(sudo vim 51-android.rules),在这个文件中写上:
SUBSYSTEM=="usb", ATTRS{idVendor}==" 05c6", ATTRS{idProduct}=="9020",MODE="0666"
保存,再为51-android.rules加上权限(sudo chmod a+x 51-android.rules).
拔掉usb重新插上就可以了,如:
xcz$ adb shell
root@msm8909:/ #
root@msm8909:/ #
root@msm8909:/ #
解决ok