我不得不处理这个问题几次,每次我都会忘记原因是什么,直到我深入挖掘。所以这是症状:
- 每次重新连接/重新启动设备时,您都会收到授权对话框,即使您可以swear你检查了Always上次勾选了。
-
adb shell
给你下面的简介
-
adb devices
给你下面的另一个简介
- 恢复期间无法通过 adb 连接
- 设备未经授权,插入时不会显示授权对话框
The adb shell
blurb:
user@PC:~$ adb shell
error: device unauthorized.
This adbd's $ADB_VENDOR_KEYS is not set; try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
The adb devices
blurb:
user@PC:~$ adb devices
List of devices attached
C4F124F1B9A98AE unauthorized
您的 udev 规则已就位并且代码输出lsusb
存在于你的/etc/udev/rules.d/51-android.rules
(或 Redhat 等效项,如果不同)
发生了什么?
好吧,对我来说,问题是你在下面看到的:
user@PC:~$ ls -al ~/.android/
total 20
drwxrwxr-x 3 user user 4096 Jun 7 15:46 .
drwxr-xr-x 30 user user 4096 Sep 19 11:30 ..
-rw------- 1 root root 1704 Jun 7 15:46 adbkey
-rw-r--r-- 1 root root 710 Jun 7 15:46 adbkey.pub
drwxrwxr-x 2 user user 4096 Jun 7 15:42 cache
注意我的adbkey
并且匹配的公钥归root所有?
我第一次跑步adb anything
在这台机器上已经是 root 了。
修复方法很简单,您可能已经知道了:sudo chown user:user ~/.android/adbkey*
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)