None of the methods listed on this page worked for me; specifically:
- I had an issue where the Settings app would crash when selecting Revoke USB debugging authorizations
- I was running LineageOS 14 x86_64
- I was using ADB over network
- The
/data/misc/adb
contained no adb_keys
file
- Removing my local
~/.android/adbkey
did not help either
- I had root access from the local terminal
- I was not getting any confirmation dialog
adb: error: failed to get feature set: 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.
- waiting for device -
In the end, I found a very useful post here that suggested to manually put the contents of ~/.android/adbkey.pub
inside the /data/misc/adb/adb_keys
file.
They suggested one of these two methods:
From another working device, copy the adb_keys
file into your computer:
# On the other Android device
cp /data/misc/adb/adb_keys /sdcard
# From your computer
adb pull /sdcard/adb_keys .
Then put the working adb_keys
file into the problematic Android device's sdcard (using Web or MTP) named as adb_keys
, then copy the file into the correct path:
# On the problematic device
cp /sdcard/adb_keys /data/misc/adb/adb_keys
The other method is to simply copy your machine's adbkey.pub
from the ~/.android/
directory, and put it into the problematic Android device's sdcard (using Web or MTP) named as adb_keys
, then copy the file into the correct path:
# On the problematic device
cp /sdcard/adbkey.pub /data/misc/adb/adb_keys
(Note: there's a similar answer on SO that goes into further details for this method.)
Since I was running a web server on my computer, and I had curl
installed on Android, I su
'ed from the terminal and ran the following on my Android device:
cd /data/misc/adb
curl 192.168.1.35:8080/adbkey.pub > adb_keys
Killed the adb
daemon (using adb kill-server
) and BAM! The adb
shell worked fine, like it should have been from the beginning.
Hopefully, the method described here works for you as it did for me.