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
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
DvxWifiScan
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.
- Remove existing adb keys on PC:
$ rm -v .android/adbkey*
.android/adbkey
.android/adbkey.pub
Remove existing authorized adb keys on device, path is /data/misc/adb/adb_keys
Now create new adb keypair
➜ ~ adb keygen .android/adbkey
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'
Manually copy from PC .android/adbkey.pub
(pubkic key) to Device on path /data/misc/adb/adb_keys
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
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.
look at this url Android adb devices unauthorized else briefly do the following:
- look for adbkey with not extension in the platform-tools/.android and delete this file
- look at
C:\Users\*username*\.android
) and delete adbkey
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.
I tried every method listed here and in Android adb devices unauthorized
What eventually worked for me was the option just below USB Debugging 'Revoke auths'
Sometimes you just need to recreate new device
I had the same problem running Ubuntu 18.04. I tried multiple solutions but my device (OnePlus 5T) was always unauthorized.
Solution
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.
Remove existing adb keys on Ubuntu:
rm -v ~/.android/adbkey* ~/.android/adbkey ~/.android/adbkey.pub
'Revoke USB debugging authorizations' on your device configuration (developer options).
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.