如何解决: Ubuntu 系统 adb devices出现no permissions

问题

$ adb devices
List of devices attached
R8V5T15B27002337    no permissions (verify udev rules); see [http://developer.android.com/tools/device.html]

二、问题的原因及解决
因为ubuntu这样的系统都是默认以非root身份在运行的,要使用usb调试,需要sudo支持

使用lsusb命令列出usb连接的设备,如;
$ lsusb
Bus 004 Device 004: ID 03f0:231d Hewlett-Packard 4 GB Flash Drive
Bus 004 Device 003: ID 0461:4dce Primax Electronics, Ltd
Bus 004 Device 008: ID 0fce:6193 Sony Ericsson Mobile Communications AB
Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 04ca:0061 Lite-On Technology Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 003: ID 138a:003c Validity Sensors, Inc. VFS471 Fingerprint Reader
Bus 003 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

列表中Bus 004 Device 008: ID 0fce:6193 Sony Ericsson Mobile Communications AB,为所连接的android设备的信息,记录一下,id为ofce(基于上所有的sony device都是这个ID)

sudo gedit /etc/udev/rules.d/51-android.rules,在打开的51-android.rules加入一下内容:

  SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666", GROUP="plugdev"
OR:
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce", ATTRS{idProduct}=="6193",MODE="0666"

然后修改udev的权限,并重启
$sudo chmod a+rx /etc/udev/rules.d/51-android.rules
$sudo service udev restart
重启 adb server, (拔掉usb重新连上再执行):
adb kill-server
adb devices
adb root


Refer to:  http://www.cnblogs.com/cat-lee/archive/2011/07/09/2101718.html
posted @ 2016-10-12 14:39  BeStrongerAndInsist  阅读(3274)  评论(0编辑  收藏  举报