欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

error: insufficient permissions for device: verify udev rules

程序员文章站 2022-06-05 14:19:59
...

error: insufficient permissions for device: verify udev rules

0x01. 查看设备

➜  ~ lsusb 
Bus 001 Device 002: ID 8087:8001 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 004: ID 04f2:b449 Chicony Electronics Co., Ltd 
Bus 002 Device 002: ID 138a:0017 Validity Sensors, Inc. Fingerprint Reader
Bus 002 Device 108: ID 17ef:6025 Lenovo ThinkPad Travel Mouse
Bus 002 Device 107: ID 1c4f:0059 SiGma Micro 
Bus 002 Device 088: ID 19d2:ffb0 ZTE WCDMA Technologies MSM //这个是自己的设备
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

0x02. 修改配置

文件位置

➜  ~ sudo emacs /etc/udev/rules.d/51-android.rules

添加下面内容

SUBSYSTEM=="usb", ATTR{idVendor}=="19d2", ATTR{idProduct}=="ffb0",MODE="0666", OWNER="iamcxl"

0x03. 进入shell

➜  ~ adb shell
error: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.

打开手机的usb调式模式,再弹出的允许usb调式对话框中选择允许.