在Ubuntu下解决 adb devices :???????????? no permissions 方法

 使用adb devices 出现以下:android

List of devices attached ubuntu

???????????? no permissions vim

同时在DDMS显示设备名也显示????????????,也没法显示进程名,没法查看log ide

解决方法: spa

1、设置usb权限 调试

由于ubuntu这样的系统都是默认以非root身份在运行的,要使用usb调试,须要sudo支持。 rest

$ lsusb orm

Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub server

Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub 进程

Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 002 Device 003: ID 413c:2106 Dell Computer Corp.

Bus 002 Device 002: ID 0461:4d81 Primax Electronics, Ltd

Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 001 Device 010: ID 0bb4:0c87 High Tech Computer Corp.

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

列表中,Bus 001 Device 010: ID 0bb4:0c87 High Tech Computer Corp这一行为htc手机的usb使用端口,记录一下,id0bb4(基于上全部的htc都是这个ID)据网上的资料说,因为后来的使用Android系统的手机愈来愈多,每款手机都分配了idVendor,但解决方法都同样。

$sudo vim /etc/udev/rules.d/70-android.rules

加入如下内容:

SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0c87",MODE="0666"

其中的idvendor idProduct指的是USBID可使用lsusb查询获得。

好比个人是:在你没有链接其余外设以前只要找到最后不是root hub的这一行留意下就行。

Bus 001 Device 010: ID 0bb4:0c87 High Tech Computer Corp

ID 0bb4 就是idVendor 0c87就是 idProduct

运行命令,重启udev

$sudo chmod a+rx /etc/udev/rules.d/70-android.rules

$sudo service udev restart

2、不须要重启计算机,从新启动adb server下就ok

(很重要)拔掉usb从新连上再执行:

sudo ./adb kill-server

./adb devices

./adb root (这一步很重要 )

相关文章
相关标签/搜索