Reputation: 1531
I have a Nexus 4 with Android 4.3 and I am trying to connect the device to a computer with Windows 7 64bit.
I installed the latest drivers and the latest adb
version. I think I tried almost everything and I still get the following message:
C:\Program Files (x86)\Android\sdk\platform-tools>adb devices
List of devices attached
007667324ccb229b unauthorized
What can be the reason for this error?
Upvotes: 153
Views: 182580
Reputation: 163
I was not getting the RSA fingerprint pop up on my phone.
I had to delete the C:\Users\<userName>\.android\adbkey
and adbkey.pub
files and then do kill and restart of adb server.
adb kill-server
adb start-server
I had to stop and restart the debugger and connecting as USB in PTP mode.
Because the RSA authorisation key was getting stored in this path, killing and restarting the adb server didn't help.
Upvotes: 2
Reputation: 1947
Simply re-plugging did the trick for me.... The permissions-dialog didn't show up the first time I plugged in the device, the second time it did and everything is fine now.
Upvotes: 0
Reputation: 1265
Had the same issue. Not sure if these are the same steps for Windows as I'm using an OS X device but you can try:
Open the terminal and type:
cd ~/.android
adb push adbkey.pub /data/misc/adb/adb_keys
All done! Just adb shell reboot
and feel the power!
Upvotes: 10
Reputation: 381
I was facing same, issue, I found I was using a simple usb cable which was meant for only charge and not data copy. using good usb cable solved my problem !
Upvotes: 0
Reputation: 2006
Here is my version of the steps:
if adb shell shows empty host name, restart device
Upvotes: 7
Reputation: 21126
Сhange USB connection mode from MTP to Camera (for Nexus 7) or, possibly, to Mass Storage or something else (for other devices). This option is usually under Settings -> Storage
. Then connect the device again, you'll get the authorization dialog.
MTP has been known to interfere with USB debugging -- these two did not work together at all on majority of older devices. Nexus 7 and many newer devices do allow both to work alongside, but this particular issue suggests it's not all that smooth yet.
Bonus -- checklist for when adb
is not behaving well:
adb kill-server
followed by adb start-server
Settings -> Developer Options -> USB Debugging
-- switch off and on/etc/udev/rules.d/51-android.rules
(again, universal solution: https://github.com/snowdream/51-android)~/.android
is owned by you, not root
(and upvote this answer)Upvotes: 44
Reputation: 350
I think it has an error when the device tries to display the screen asking for permission, so it does not appear.
This works for me (commands are given in the adb shell
):
rm /data/misc/adb/adb_keys
;stop adbd
;cat adbkey.pub >> /data/misc/adb/adb_keys
(authorize myself);start adbd
(restart adb with new keys).Upvotes: 24
Reputation: 7339
This kind of an old post and in most cases I think the answer that has been upvoted the most will work for people.
In Lollipop on a GPE HTC M8 I was still having problems. The below steps worked for me.
adb devices
Now you should get the RSA popup on your phone.
Upvotes: 1
Reputation: 6177
My resolution was running adb devices
from the command prompt, pathed to the adb application. For example C:\Android\platform-tools\adb devices . Running this command returned the following * daemon not running. starting it now on port 5037 *
*daemon started successfully *
I then saw the device listed as unauthorized, unplugges the USB, plugged back in and was prompted for the RSA fingerprint.
Upvotes: 0
Reputation: 3481
If you are on adb over network, try to connect via USB instead or vice versa. This did the trick for me. After accepting it once it always works later on.
Upvotes: 1
Reputation: 2154
It happened for me after my backup software changed the permission to my user directory. I opened it in File Explorer, it prompted me to set permissions and it fixed the issue.
FYI: Android has a special directory under "\User\.android" If you can't access it, it won't prompt you.
Upvotes: 0
Reputation: 29213
For my Samsung S3, I had to go into Developer Options on the phone, untick the "USB debugging" checkbox, then re-tick it.
Then the dialog will appear, asking if you want to allow USB Debugging.
Once I'd done this, the "adb devices
" command no longer showed "unauthorized" as my device name.
(Several months later..)
Actually, the same was true for connecting my Galaxy Tab S device, and the menu options were in slightly different places with Android 4.4.2:
Upvotes: 8
Reputation: 3201
Use a different USB cable. Some cables may not have all pins connected or whatnot, and while they work for image transfer, the debugging/adb does not work.
The bottom line: I kid you not. A cable which works for my phone (adb works) does NOT work for my tablet - the device is always offline or unauthorized and tablet pops out no dialog. I tried multiple reboots, settings, I went berserk in the process and cursed the bloody Android. Then accidentally I plugged in the cable which came with the tablet and suddenly it worked. My fascination with Android is definitely gone. What a stupid piece of junk.
Upvotes: 0
Reputation: 68985
After you ensure you have enabled USB debugging unlock your phone and plug it into your machine via USB. You will be then asked to authorize communication with the computer you have connected to. It will also show computers RSA key fingerprint.
Accept it and you are good to go!
Upvotes: 17
Reputation: 678
Similar to Flavio's answer (https://stackoverflow.com/a/18542792/1064996), it was something to do with the files in ~/.android
(on the host machine, not the phone).
I didn't have ~/.android/adbkey
, but I did have ~/.android/debug.keystore
and my whole ~/.android
directory was owned by root. I removed the keystore file and also changed ownership to me (sudo chown -R $USER ~/.android
), killed the adb server and plugged in my phone, and it worked.
It was probably the ownership thing. Make sure you have read/write permissions in ~/.android
Upvotes: 9
Reputation: 11
For me once I disabled MTP (in Settings>Storage>Menu>MTP) I finally got the RSA prompt
Upvotes: 1
Reputation: 39695
When I turn off my Comodo Antivirus everything goes back normal. All other solutions suggested here went in vain. Somehow I figured out one solution.
If you are using Comodo Antivirus (Version 6.3/ For other versions search for similar options) the following solution would help you.
Open Comodo > Tasks > Advanced Tasks > Open Advanced Settings > Security Settings > Firewall > Firewall Settings > Advanced : Filter loopback traffic (e.g. 127.x.x.x, ::1)
Uncheck this "Filter loopback traffic" option, which prevents adb from normal working.
Upvotes: 0
Reputation: 41
I reinstalled the usb
drivers and ensured that I was not using USB 3.0
port.
I then closed out eclipse and killed and restarted adb
.
Was immediately prompted on phone to allow computer access. After accepting I restarted eclipse and now my Galaxy S3 shows up in device Device Manager.
Upvotes: 1
Reputation: 43
I had to re-install my adb driver to snap out of this probelm. I had install "Universal Naked Driver" in an effort to recover my phone. I uninstalled that and re-installed the driver out of the android sdk.
Upvotes: 0
Reputation: 573
Had the same issues getting an authorization token on my Nexus 5 on Windows 8.1. I didn't have the latest adb driver installed - this is visible in device manager. Downloaded the latest ADB USB driver from Google here: http://developer.android.com/sdk/win-usb.html
Updated the driver in device manager, however enable/disable USB debugging and unplugging/plugging USB still did not work. Finally the "adb kill-server" and "adb start-server" mentioned in other answers did the trick once the driver was updated.
Upvotes: 6
Reputation: 453
Upvotes: 4
Reputation: 1948
I solved this problem without deleting any keys. Here's how:
Upvotes: 57
Reputation: 111
1.) Delete ~/.android/adbkey on your desktop machine
2.) Run command "adb kill-server"
3.) Run command "adb start-server"
You should now be prompted to accept debug key.
Upvotes: 11
Reputation: 1912
Four easy steps
./adb kill-server
./adb start-server
replug the device, unlock it and accept the new key
Upvotes: 8
Reputation: 6570
I had similar situation. Here is what I did:
Try to check and uncheck the USB Debugging option in the device. (if not working, try to unplug/plug the USB)
At some point, the device should show up a messagebox to ask you if you authorize the computer. After you click yes, the device is then authorized and the connection is hooked.
Upvotes: 264
Reputation: 800
I was able to solve this one by following the steps listed here:http://forum.xda-developers.com/showthread.php?t=2247471
delete the computers adb key: rm /data/misc/adb/adb_key on device
(I have no idea if in case of multiple authorized computers the additional keys are in a new line of the file or if they are in new files. I have only 1 computer.)
stop all adb processes "killall adb" in linuxoids and "taskkill /IM adb.exe" in windows or simply the taskmanager in both.
restart the phone
toggle usb debugging off and on
connect
use adb
click authorize
Upvotes: 0