android-build

adb devices: ?????? no permissio

2018-04-02  本文已影响6人  97690CE50CC872D

adb devices: ?????? no permissions解决办法

  1. $ adb devices
    输出:
    List of devices attached
    ?????? no permissions
  2. Ubuntu系统默认以非root身份在运行,要使用usb调试,需要sudo支持
    $ lsusb
    输出:
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 001 Device 002: ID 8087:8009 Intel Corp. 
    Bus 001 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 003 Device 019: ID 05c6:9091 Qualcomm, Inc. 
    Bus 003 Device 002: ID 1bcf:0007 Sunplus Innovation Technology Inc. Optical Mouse
    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub```
    (列表中, Bus 003 Device 019: ID 05c6:9091 Qualcomm, Inc.这就是我所使用的高通平台的Android手机的usb使用端口,id为05c6)
    
  3. 编辑文件
    $ sudo vim /etc/udev/rules.d/70-android.rules
    加入以下内容:
    SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666", GROUP="plugdev"
  4. 重启udev
    $ sudo chmod a+rx /etc/udev/rules.d/70-android.rules
    $ sudo service udev restart
  5. 重启adb server (这两条命令需要 sudo -s 切换到root用户执行,之后可以退出root用户)
    $ adb kill-server
    $ adb start-server
  6. 输入adb devices
    $ adb devices
    输出:List of devices attached
    e796a5e device

no permissions fastboot解决办法

  1. $ fastboot -l devices
    输出:no permissions fastboot usb:3.9
  2. 增加权限将fastboot的所有者属性改成root:
    $ which fastboot
    输出:/usr/bin/fastboot
    $ cd /usr/bin/ 进入到此目录
    $ sudo chown root:root fastboot
    $ ls -l fastboot
    输出:-rwxr-xr-x 1 root root 93216 4月 1 2014 fastboot
  3. 将权限修改:
    $ sudo chmod +s fastboot
    $ ls -l fastboot
    输出:-rwsr-sr-x 1 root root 93216 4月 1 2014 fastboot*
  4. 使用fastboot devices 可以查看到挂载设备,烧入img
    $ fastboot flash system '/home/xmai/Desktop/system.img'
    输出: sending 'system'(69553kB)
    OKAY [ 1.375s ]
    Writing 'system'...
    OKAY [ 1.251s ]
    finished. total time:2.626s
上一篇下一篇

猜你喜欢

热点阅读