[Ubuntu] 虚拟机中adb连接失败 no permissions (user in plugdev group; are your udev rules wrong?)
连接手机至虚拟机,可以识别
$ lsusb
Bus 001 Device 002: ID 05c6:90db Qualcomm, Inc.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
虚拟中安装adb后,使用adb devices,能看到id,但提示用户无权限
$ adb devices
List of devices attached
6c72c46d no permissions (user in plugdev group; are your udev rules wrong?); see [http://developer.android.com/tools/device.html]
adb shell 指令不能用
$ adb shell
error: insufficient permissions for device: user in plugdev group; are your udev rules wrong?
See [http://developer.android.com/tools/device.html] for more information
解决办法:
1、在下面路径创建规则文件
/etc/udev/rules.d/xxx.rules
2、规则文件中输入以下内容
SUBSYSTEM=="usb", MODE="0660", GROUP="plugdev", SYMLINK+="android%n"
3、再次拔插手机即可