1. 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.
    

I did "adb kill-server", but it didn't change anything. Why?

353341 次浏览

diff --git a/core/main.mk b/core/main.mk
index a6f829ab6..555657539 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -362,6 +362,8 @@ else # !enable_target_debugging
ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=0
endif # !enable_target_debugging


+ADDITIONAL_DEFAULT_PROPERTIES += ro.adb.secure=1
+
## eng ##


ifeq ($(TARGET_BUILD_VARIANT),eng)

-path to C:\Users\User\AppData\Local\Android\sdk\platform-tools
-Shift+r.click and start command from here instead.

    adb kill-server
  • adb start-server
    
  1. $ chmod 710 .android/
    $ chown -R ashan:ashan .android/
    
  2. Go to developer options in your mobile and tap option Revoke USB debugging authorizations

  3. Turn off all USB Debugging and Developer Options in the device and disconnect the device from your machine.

  4. Connect the device again and at first turn on the Developer Options. Then Turn on the USB debugging.

  5. At this point in your mobile, you will get a prompt for asking permission from you. Note: you must check the checkbox always accept from this …. option and click ok.

  6. Now in you machine, start the adb server: adb start-server.

  7. Hopefully when you issue the command: adb devices now, you will see your device ready authorized.

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 -

  1. # On the other Android device
    cp /data/misc/adb/adb_keys /sdcard
    
    # From your computer
    adb pull /sdcard/adb_keys .
    

    # On the problematic device
    cp /sdcard/adb_keys /data/misc/adb/adb_keys
    
  2. 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
    

cd /data/misc/adb
curl 192.168.1.35:8080/adbkey.pub > adb_keys

1- Go to ~/.android/ and remove “adbkey”
2- Disconnect USB connection
3- adb kill-server
4- Revoke USB debugging authorizations (in developer option)
5- Reconnect the device to the Ma
6- adb devices
Disconnect USB between PC and device
Stop adb server by entering "adb kill-server" in command window
On device use "Revoke USB debugging authorizations" in "Developer Options"
On PC delete "adbkey" file in user directory, for example "C:\Users\Amit\.android"
Reconnect the device to the PC
Open a command window and enter "adb devices". Watch the device's screen for any Authorization message and allow the connection.