adb no permissions问题


 Google一番,得知可以通过用root权限启动adb server来解决问题,但是每次用adb不会很麻烦嘛?!

后来发现在SDK的帮助文档里有关于这个问题的说明:

If you’re developing on Ubuntu Linux, you need to add a rules file that contains a USB configuration for each type of device you want to use for development. Each device manufacturer uses a different vendor ID. The example rules files below show how to add an entry for a single vendor ID (the HTC vendor ID). In order to support more devices, you will need additional lines of the same format that provide a different value for the SYSFS{idVendor} property. For other IDs, see the table of USB Vendor IDs, below.

  1. Log in as root and create this file: /etc/udev/rules.d/51-android.rules.

    For Gusty/Hardy, edit the file to read:
    SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"

    For Dapper, edit the file to read:
    SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bb4", MODE="0666"

  2. Now execute:
    chmod a+r /etc/udev/rules.d/51-android.rules

 

只要按照说明,在/etc/udev/rules.d/目录下创建51-android.rules文件,写入自己手机的信息就好了。
什么?你有多个不同品牌的Android手机或平板?每一个都添加自然是可以的,当然也有简便方法啦。
只要在51-android.rules中保留一行

1 SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0666"

就好了~
修改以后重新插入你的Android设备,运行adb devices命令看看:

 

List of devices attached
M1105bfb6840 device

怎么样可以识别了吧~

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值