ubuntu 下鏈接android真機報無權限的錯誤no permissions的解決方案

今天在linux下鏈接平板usb,試用adb shell時出現error: insufficient permissions for device,linux

並且咱們輸入adb devices顯示:android

xxnan@xxnan-pt:~$ adb devices
List of devices attached
????????????    device
那麼咱們怎麼解決它呢?shell


首先在終端查看usb的ID,輸入lsusb命令,咱們能夠看到咱們剛插如usb的ID號,如:vim

xxnan@xxnan-pt:~$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 003: ID 0461:4d80 Primax Electronics, Ltd
Bus 001 Device 004: ID 1c7a:0801 LighTuning Technology Inc. Fingerprint Reader
Bus 002 Device 003: ID 5986:0190 Acer, Inc
Bus 001 Device 019: ID 0bb4:0c02 High Tech Computer Corp. Dream / ADP1 / G1 / Magic / Tattoo (Debug)

紅色的就是咱們插入usb的ID號。
spa

那麼咱們進入到cd /etc/udev/rules.d/下,新建一個51-android.rules文件(sudo  vim  51-android.rules),在這個文件中寫上:ci

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

保存,再爲51-android.rules加上權限(sudo chmod a+x 51-android.rules).List

拔掉usb從新插上就能夠了,如:終端

xxnan@xxnan-pt:~$ adb devices
List of devices attached
AB100607    device權限

這樣就解決了不能識別USB的問題。

相關文章
相關標籤/搜索