Set adb vendor keys

AndroidAndroid StudioAdbAtt

Android Problem Overview


EDIT: I figured out the problem, i think. ADB found out I wasn't on the latest updates (at&t released a stagefright udpate and i didnt know) so ADB didn't let me debug. Everything is fine now.

I have been debugging my app on an AT&T HTC One M8 for about a month. Suddenly today when I plugged in my phone, I didn't get the authorization popup. After an hour of troubleshooting, I found the problem, but not a solution.

This is the error i get in Android Studio 1.3.1:

>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 googled $ADB_VENDOR_KEYS but to no avail.

Information:

  • Phone: AT&T HTC One M8 running 5.0.1 (API 21)
  • Android Studio version 1.3.1 build 141.2135290
  • JDK Version: 1.8.0_60

How can I get the popup again? I need to debug my app

Android Solutions


Solution 1 - Android

In this case what you can do is : Go in developer options on the device Uncheck "USB Debugging" then check it again A confirmation box should then appear

Solution 2 - Android

I tried almost anything but no help...

Everytime was just this

➜  ~ adb devices    
List of devices attached
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
aeef5e4e	unauthorized

However I've managed to connect device!

There is tutor, step by step.

  1. Remove existing adb keys on PC:
    .android/adbkey
    .android/adbkey.pub
  1. Remove existing authorized adb keys on device, path is /data/misc/adb/adb_keys

  2. Now create new adb keypair

    adb I 47453 711886 adb_auth_host.cpp:220] generate_key '.android/adbkey'
    adb I 47453 711886 adb_auth_host.cpp:173] Writing public key to '.android/adbkey.pub'```

4. Manually copy from PC `.android/adbkey.pub` (pubkic key) to Device on path `/data/misc/adb/adb_keys`

5. Reboot device and check `adb devices` : 

```➜  ~ adb devices
List of devices attached
aeef5e4e	device```


Permissions of `/data/misc/adb/adb_keys` are `(766/-rwxrw-rw-)` on my device

Solution 3 - Android

look at this url https://stackoverflow.com/questions/31638582/android-adb-devices-unauthorized else briefly do the following:

  1. look for adbkey with not extension in the platform-tools/.android and delete this file
  2. look at C:\Users\*username*\.android) and delete adbkey
  3. C:\Windows\System32\config\systemprofile\.android and delete adbkey

You may find it in one of the directories above. Or just search adbkey in the Parent folders above then locate and delete.

Solution 4 - Android

If you have an AVD, this might help.

Open the AVD Manager from Android Studio. Choose the dropdown in the right most of your device row. Then do Wipe Data. Restart your virtual device, and ADB will work.

Solution 5 - Android

I tried every method listed here and in https://stackoverflow.com/questions/31638582/android-adb-devices-unauthorized

What eventually worked for me was the option just below USB Debugging 'Revoke auths'

Solution 6 - Android

I had the same problem running Ubuntu 18.04. I tried multiple solutions but my device (OnePlus 5T) was always unauthorized.

Solution

  1. Configure udev rules on Ubuntu. To do this, just follow the official documentation: https://developer.android.com/studio/run/device

The idVendor of my device (OnePlus) is not listed. To get it, just connect your device and use lsusb:

Bus 003 Device 008: ID 2a70:4ee7

In this example, 2a70 is the idVendor.

  1. Remove existing adb keys on Ubuntu:

    rm -v ~/.android/adbkey* ~/.android/adbkey ~/.android/adbkey.pub

  2. 'Revoke USB debugging authorizations' on your device configuration (developer options).

  3. Finally, restart the adb server to create a new key:

    sudo adb kill-server sudo adb devices

After that, I got the authorization prompt on my device and I authorized it.

Solution 7 - Android

Sometimes you just need to recreate new device

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionLonelyIdiotView Question on Stackoverflow
Solution 1 - AndroidDvxWifiScanView Answer on Stackoverflow
Solution 2 - AndroidColChView Answer on Stackoverflow
Solution 3 - AndroidMluView Answer on Stackoverflow
Solution 4 - AndroidsubashView Answer on Stackoverflow
Solution 5 - AndroidkilljoyView Answer on Stackoverflow
Solution 6 - AndroidJuan GarcíaView Answer on Stackoverflow
Solution 7 - AndroidIvanMView Answer on Stackoverflow