Related
Since I reinstalled Eclipse (simply deleted and downloaded it again) I can't debug my applications on Samsung Galaxy i9001 (with CyanogenMod - Android 4.4.2). It worked fine before reinstallation.
Unplug/plug, Uncheck/check "Debug Enabled", adb kill-server/adb start-server, restart phone/computer doesn't work for me. On the device authorize dialog never appears (but I remember that dialog appeared before reinstallation). I have no idea how to force this authorize dialog to display. There is no abd_key.pub file in .android directory.
When i try read cpu info DDMS says:
[2014-04-15 12:47:06 - DDMS] device unauthorized. Please check the confirmation dialog on your device.
Any ideas? Is it possible to generate keys manually without confirmation dialog?
USB Connection
Wireless Connection
It's likely that the device is no longer authorized on ADB for whatever reason.
1. Check if authorized:
<ANDROID_SDK_HOME>\platform-tools>adb devices
List of devices attached
4df798d76f98cf6d unauthorized
2. Revoke USB Debugging on phone
If the device is shown as unauthorized, go to the developer options on the phone and click "Revoke USB debugging authorization" (tested with JellyBean & Samsung GalaxyIII).
3. Restart ADB Server:
Then restarted adb server
adb kill-server
adb start-server
4. Reconnect the device
The device will ask if you are agree to connect the computer id.
You need to confirm it.
5. Now Check the device
It is now authorized!
adb devices
<ANDROID_SDK_HOME>\platform-tools>adb devices
List of devices attached
4df798d76f98cf6d device
Try forcing ADB to create new keys.
On Linux/OSX:
$ mv ~/.android/adbkey ~/.android/adbkey.old
$ mv ~/.android/adbkey.pub ~/.android/adbkey.pub.old
$ adb kill-server
$ adb start-server
On Windows 10 (thank you, Pau Coma Ramirez, Naveen and d4c0d312!):
Go to %HOMEPATH%\Android\.android\
Look for files called adbkey or adbkey.pub.
Delete these files. Or, if you want to be on the safe side, move them to another directory.
Repeat the above steps in %USERPROFILE%\.android\
Try again
After this I didn't even need to unplug my phone: the authorization prompt was already there.
Ohhh finally I figured it out!
After removing Eclipse directory I installed it into another directory.
echo %ANDROID_SDK_HOME%
has displayed wrong path to sdk directory.
set ANDROID_SDK_HOME "E:\adt-bundle-windows-x86_64-20140321\sdk"
unplug device
adb kill-server
adb start-server
plug device
After these steps, I was able to see confirmation dialog with RSA fingerprint on my phone :)
I run into the same issues with nexus7.
Following worked for fixing this.
Open Developer option in the Settings menu on your device.
Switch off the button on the upper right of the screen.
Delete all debug permission from the list of the menu.
Switch on the button on the upper right of the screen.
now reconnect your device to your PC and everything should be fine.
Sorry for my poor english and some name of the menus(buttons) can be incorrect in your language because mine is Japanese.
I had the same problem. It was resolved by setting "USB computer connection" to "Camera (PTP)" instead of "Media Device (MTP)
I wasted hours on this stupid issue. None of the above solutions worked for me on their own.
I'm running Windows 10. I had an old manual install of the Android SDK as well as Android Studio's SDK. I deleted my manually installed SDK and all my devices stopped working. These were the symptoms:
$ adb usb
error: 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.
as well as
$ adb devices
List of devices attached
id1 unauthorized
id2 unauthorized
id3 unauthorized
To be honest I'm not sure which of these steps got me my Allow USB debugging? prompts back so I listed EVERYTHING for completeness. Goes in order from easiest to hardest. Most people seem to be back on their feet after the first two sections.
Restart ADB
I would perform this after each of the sections below.
adb kill-server
adb usb
Go crazy with developer options
Turn Developer options off and back on
Turn USB debugging off and back on
Revoke USB debugging authorizations. Try this while USB debugging is on and if possible try also when USB debugging is off.
Replug devices
Unplug and replug USB cable into phone.
Switch physical ports on your PC that your USB cable is connected into
Switch physical USB cables you're using to connect your devices
Start rebooting everything
Reboot all your devices and connect again
Reboot your PC
Toggle WIFI on and off
Start deleting things
CAUTION Delete your ~/.android folder. Sometimes this folder can have the wrong permissions which can cause issues. You might want to back this folder up first.
Uninstall all manufacturer specific drivers from add/remove programs. I uninstalled the following (names are not exact)
LG United USB Driver
HTC Mobile USB Driver
OnePlus USB Drivers 1.00
Samsung USB Driver
I also uninstalled all emulators and their respective drivers (optional)
Nox & related drivers
Bluestacks
Genymotion
Erase all Android related environment variables.
Delete %ANDROID_HOME% if you have it set
Delete %ANDROID_SDK_HOME% if you have it set
At this point all my devices magically came to life and started displaying the Allow USB debugging? prompts and connecting properly through ADB. If you've made it this far and haven't found a solution, I am truly sorry you're in this predicament. Make sure you've restarted all devices and your dev machine at the end of all of these steps and connect to a fresh USB port using a new cable.
If that still doesn't work try some of these other SO posts on the subject:
Android ADB device offline, can't issue commands
Can't connect Nexus 4 to adb: unauthorized
How to solve ADB device unauthorized in Android ADB host device?
For me, I firstly unauthorized my device accidentally which I found out later. To revert it back to reauthorise:
Disconnect USB device from laptop/computer
Click 'Revoke USB debugging authorisations' in Developer options.
Disable developer options on top.
re-enable it again.
enable USB debugging
run command 'adb kill-server' on terminal
run command 'adb start-server' on terminal
connect your mobile device to laptop/computer
reauthorize
press like)
Note: if above doesn't work, trying restarting your laptop before connecting again
For reference, I just encountered much the same issue on Linux and had a hell of a time figuring it out. I eventually determined that I had a ~/.android directory that was root owned (thanks to running adb as root, while flailing around trying to figure out other connection problems). Deleting that root owned ~/.android directory resolved the missing authorisation dialog next time I reconnected the device.
It's possible that simply changing the ownership would also have fixed the problem - I'm guessing it was a simple lack of access to the adb key file stored inside that was the root of the problem. I didn't verify that, though, and I'm not going to deliberately break my hard-won connectivity just so I can check ;-)
Steps that worked for me:
1. Disconnect phone from usb cable
2. Revoke USB Debugging on phone
3. Restart the device
4. Reconnect the device
The most important part was rebooting the device. Didn't work without it .
After having spent over an hour going in rounds swearing at Samsung (mostly), Google, and who not, here are my findings, that finally helped me get the device recognized:
On Device:
Set developer mode
Allow USB debugging
Default USB configuration > Select USB tethering
Connect device to PC USB
On PC:
Elevated cmd/ps prompt (maybe not mandatory, but that was my drill)
adb kill-server (precede with .\ in ps)
adb start-server (while device connected) > watch for prompt on device
On device:
Always allow connections from this computer > Yes
On PC:
adb devices gets the following output:
List of devices attached
278c250cce217ece device
Had similar issue on osx and Nexus 5 (A6.0.1).
I did get the authorization pop-up and confirmed it, despite that Android Studio nor any other IDE could connect to device.
Turned out my Nexus (rooted) was missing key files.
Rebooted Android device into recovery
Ran code pasted below
Rebooted Android device, adb now identifies device
Push key from computer to Android device:
cd ~/.android && adb push adbkey.pub /data/misc/adb/adb_keys
Solution came from here
I was getting this error with my Nexus 10. I tried all of the answers I could find, and then I realized I was using a different USB port than usual. I switched to using the port I usually use, which is on the other side of my laptop, and the authorization popped up on my tablet!
As the message have stated, you need to allow the adb access on your phone.
You need to first connect the phone to your PC with USB cables, then the authorization message will pop out on the screen. Tick remember your choice, then allow it.
IF your device doesnt shows any messages when connected to the PC.Just do this.
Remove /data/misc/adb/adb_key, reboot your phone and try connect
again. The message should come up.
Recheck 'USB Debug' option in developer options helped me
The solution is to copy your file ~/.android/adbkey.pub (on GNU/Linux, or %USERPROFILE%\.android\adbkey.pub on Windows) to Android, and place it as /data/misc/adb/adb_keys. You need root privileges to do that.
You can transfer the file any way you like (or are able to), be it USB, e-mail or a temporary file upload service. In my case, as it was a new Android-x86 installation in a Virtual Machine, no usable web browser, and with network/TCP adb not working, I had to actually type in the 715 characters.
At least it worked.
If you are on ubuntu, try running the server as root:
sudo adb kill-server
sudo adb start-server
Simply, turn off developer options from your device and again turn on, attach USB with the device and working system and turn on USB debugging.
I was tiered with this, I got that permission dialog by turning off wi-fi of my phone.
Disconnect your device from the computer.
Go into developer settings.
Turn off developer settings.
Turn on developer settings.
Enable USB Debugging (and whatever other settings you enabled beforehand)
Reconnect your device to the computer.
Try again.
Worked for me so hope it works for you!
I was not getting the RSA fingerprint pop up on my phone.
I had to go into the
C:\Users\<userName>\.android\adbkey and adbkey.pub
files, delete those and then do kill and restart of adb 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.
This solved my issue!
run your android simulator
go to setting and enable developer mode
enable from the developer settings usb debugging
at this point you will get popup massage at you emulator to authorise the device and you are good to go :)
You should delete the file: c:\users\_user_name_\.android\adbkey
On some Samsung devices the mode change that can be set by dialing *#0808# doesn't stick without direct reboot. Once rebooted, dial the same string and make sure that you have adb + mdp selected and USB set to AP. After this make sure to reconnect phone and restart ADB server. Also try to avoid USB hubs and virtual machines witch surely complicate matter further. The follow the previously mentioned instructions for clearing authorized devices etc.
I had a similar problem. However, it was solved using a different solution. I thought I might share this here as well. Let me describe my problem first.
I had the Android SDK in my ubuntu. The path to the android SDK was not in the environment variable path. I installed adb using a apt-get command and it could not find the sdk home folder and hence, it was showing the unauthorized error and the device was not popping up anything as well. I got stuck here.
Then I uninstalled the adb using apt-get purge which I installed earlier. The Android SDK has the adb program in the platform-tools folder. I just add the path to the environment variable and it worked like a charm.
export PATH=${PATH}:/home/YOUR-USERNAME/path/to/adb
adb devices
List of devices attached
f7f716d56905 device
Hence the problem was not setting the Android SDK to the environment variable path.
The same issue started appearing once I changed my development device, it was solved as:
$ mv ~/.android/adbkey ~/.android/adbkey.old
$ mv ~/.android/adbkey.pub ~/.android/adbkey.pub.old
$ adb kill-server
$ adb start-server
I had the same message in two phones:
- Sony Xperia E
- Samsung Galaxy Core 2
both Android 4.4.2, and i solved it with these two steps:
1.- Updating my adb to 1.0.31, downloading the latest version of Android SDK from SDK Manager
You can check your adb version by typing
adb version
2.- Once the phone is plugged in USB Debugging mode, A message appears asking you to authorize this computer for debugging. You have to mark "Always allow this computer", and click on Allow.
Hope it helps.
it's not may work for all situations but because i used a long cable my device doesnt connect properly and the message wont pop up
change the cable may solve the problem
I just try adb kill-server, it works for me:
PS C:\Users\languoguang> adb devices
List of devices attached
MKJ0117A19000186 unauthorized
PS C:\Users\languoguang> adb shell
error: 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.
kill and start adb server:
PS C:\Users\languoguang> adb kill-server
PS C:\Users\languoguang> adb start-server
* daemon not running; starting now at tcp:12345
* daemon started successfully
PS C:\Users\languoguang> adb devices
List of devices attached
MKJ0117A19000186 device
Here's what I did that that brought the authorization prompt and made my device appear. I used a Samsung Galaxy s7 edge.
Enable developer mode and USB debugging on your device.
Revoke the USB debugging authorization
Plug your phone to computer via USB.
Drag notification panel and select "Software Installation" as shown in the image below
This will begin installing USB driver and the prompt for USB debugging authorization will show.
Check if you have Samsung Kies installed. That is one possible solution
Lenovo A606
Android 4.4.2
OSX El Capitan
Developer mode is on
USB debugging is on
I already added the Android Tools Directory to PATH
When running adb devices on the command line, it just returns a blank list.
How can I make my laptop recognize my phone in order to test my code on a physical device?
If you find it out, let me know lol
There are so many possibilities. In order of importance:
Drivers are not installed for your device.
Even if the drivers are not installed, your USB port may not supply enough power to the device. Try changing port.
Even if the drivers are installed your USB Cable may be buggy. Try changing it.
Your ADB process may be not synced. Try with the following commands. abd kill-server and then adb start-server.
You may be running more than one adb processes.
Try restarting Android Studio / Eclipse / ...
Try restarting your computer.
Try cleaning the computer allowed to use your device from Settings and re-connect again your device.
Did you enable the developer mode and enable depuration?
Throw your computer, with USB cable and USB device through the window. Just kidding lol.
Possibly your usb cord is just a charger? When you plug in your phone can you see your pictures? If not maybe try a different connector.
Since I reinstalled Eclipse (simply deleted and downloaded it again) I can't debug my applications on Samsung Galaxy i9001 (with CyanogenMod - Android 4.4.2). It worked fine before reinstallation.
Unplug/plug, Uncheck/check "Debug Enabled", adb kill-server/adb start-server, restart phone/computer doesn't work for me. On the device authorize dialog never appears (but I remember that dialog appeared before reinstallation). I have no idea how to force this authorize dialog to display. There is no abd_key.pub file in .android directory.
When i try read cpu info DDMS says:
[2014-04-15 12:47:06 - DDMS] device unauthorized. Please check the confirmation dialog on your device.
Any ideas? Is it possible to generate keys manually without confirmation dialog?
USB Connection
Wireless Connection
It's likely that the device is no longer authorized on ADB for whatever reason.
1. Check if authorized:
<ANDROID_SDK_HOME>\platform-tools>adb devices
List of devices attached
4df798d76f98cf6d unauthorized
2. Revoke USB Debugging on phone
If the device is shown as unauthorized, go to the developer options on the phone and click "Revoke USB debugging authorization" (tested with JellyBean & Samsung GalaxyIII).
3. Restart ADB Server:
Then restarted adb server
adb kill-server
adb start-server
4. Reconnect the device
The device will ask if you are agree to connect the computer id.
You need to confirm it.
5. Now Check the device
It is now authorized!
adb devices
<ANDROID_SDK_HOME>\platform-tools>adb devices
List of devices attached
4df798d76f98cf6d device
Try forcing ADB to create new keys.
On Linux/OSX:
$ mv ~/.android/adbkey ~/.android/adbkey.old
$ mv ~/.android/adbkey.pub ~/.android/adbkey.pub.old
$ adb kill-server
$ adb start-server
On Windows 10 (thank you, Pau Coma Ramirez, Naveen and d4c0d312!):
Go to %HOMEPATH%\Android\.android\
Look for files called adbkey or adbkey.pub.
Delete these files. Or, if you want to be on the safe side, move them to another directory.
Repeat the above steps in %USERPROFILE%\.android\
Try again
After this I didn't even need to unplug my phone: the authorization prompt was already there.
Ohhh finally I figured it out!
After removing Eclipse directory I installed it into another directory.
echo %ANDROID_SDK_HOME%
has displayed wrong path to sdk directory.
set ANDROID_SDK_HOME "E:\adt-bundle-windows-x86_64-20140321\sdk"
unplug device
adb kill-server
adb start-server
plug device
After these steps, I was able to see confirmation dialog with RSA fingerprint on my phone :)
I run into the same issues with nexus7.
Following worked for fixing this.
Open Developer option in the Settings menu on your device.
Switch off the button on the upper right of the screen.
Delete all debug permission from the list of the menu.
Switch on the button on the upper right of the screen.
now reconnect your device to your PC and everything should be fine.
Sorry for my poor english and some name of the menus(buttons) can be incorrect in your language because mine is Japanese.
I had the same problem. It was resolved by setting "USB computer connection" to "Camera (PTP)" instead of "Media Device (MTP)
I wasted hours on this stupid issue. None of the above solutions worked for me on their own.
I'm running Windows 10. I had an old manual install of the Android SDK as well as Android Studio's SDK. I deleted my manually installed SDK and all my devices stopped working. These were the symptoms:
$ adb usb
error: 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.
as well as
$ adb devices
List of devices attached
id1 unauthorized
id2 unauthorized
id3 unauthorized
To be honest I'm not sure which of these steps got me my Allow USB debugging? prompts back so I listed EVERYTHING for completeness. Goes in order from easiest to hardest. Most people seem to be back on their feet after the first two sections.
Restart ADB
I would perform this after each of the sections below.
adb kill-server
adb usb
Go crazy with developer options
Turn Developer options off and back on
Turn USB debugging off and back on
Revoke USB debugging authorizations. Try this while USB debugging is on and if possible try also when USB debugging is off.
Replug devices
Unplug and replug USB cable into phone.
Switch physical ports on your PC that your USB cable is connected into
Switch physical USB cables you're using to connect your devices
Start rebooting everything
Reboot all your devices and connect again
Reboot your PC
Toggle WIFI on and off
Start deleting things
CAUTION Delete your ~/.android folder. Sometimes this folder can have the wrong permissions which can cause issues. You might want to back this folder up first.
Uninstall all manufacturer specific drivers from add/remove programs. I uninstalled the following (names are not exact)
LG United USB Driver
HTC Mobile USB Driver
OnePlus USB Drivers 1.00
Samsung USB Driver
I also uninstalled all emulators and their respective drivers (optional)
Nox & related drivers
Bluestacks
Genymotion
Erase all Android related environment variables.
Delete %ANDROID_HOME% if you have it set
Delete %ANDROID_SDK_HOME% if you have it set
At this point all my devices magically came to life and started displaying the Allow USB debugging? prompts and connecting properly through ADB. If you've made it this far and haven't found a solution, I am truly sorry you're in this predicament. Make sure you've restarted all devices and your dev machine at the end of all of these steps and connect to a fresh USB port using a new cable.
If that still doesn't work try some of these other SO posts on the subject:
Android ADB device offline, can't issue commands
Can't connect Nexus 4 to adb: unauthorized
How to solve ADB device unauthorized in Android ADB host device?
For me, I firstly unauthorized my device accidentally which I found out later. To revert it back to reauthorise:
Disconnect USB device from laptop/computer
Click 'Revoke USB debugging authorisations' in Developer options.
Disable developer options on top.
re-enable it again.
enable USB debugging
run command 'adb kill-server' on terminal
run command 'adb start-server' on terminal
connect your mobile device to laptop/computer
reauthorize
press like)
Note: if above doesn't work, trying restarting your laptop before connecting again
For reference, I just encountered much the same issue on Linux and had a hell of a time figuring it out. I eventually determined that I had a ~/.android directory that was root owned (thanks to running adb as root, while flailing around trying to figure out other connection problems). Deleting that root owned ~/.android directory resolved the missing authorisation dialog next time I reconnected the device.
It's possible that simply changing the ownership would also have fixed the problem - I'm guessing it was a simple lack of access to the adb key file stored inside that was the root of the problem. I didn't verify that, though, and I'm not going to deliberately break my hard-won connectivity just so I can check ;-)
Steps that worked for me:
1. Disconnect phone from usb cable
2. Revoke USB Debugging on phone
3. Restart the device
4. Reconnect the device
The most important part was rebooting the device. Didn't work without it .
After having spent over an hour going in rounds swearing at Samsung (mostly), Google, and who not, here are my findings, that finally helped me get the device recognized:
On Device:
Set developer mode
Allow USB debugging
Default USB configuration > Select USB tethering
Connect device to PC USB
On PC:
Elevated cmd/ps prompt (maybe not mandatory, but that was my drill)
adb kill-server (precede with .\ in ps)
adb start-server (while device connected) > watch for prompt on device
On device:
Always allow connections from this computer > Yes
On PC:
adb devices gets the following output:
List of devices attached
278c250cce217ece device
Had similar issue on osx and Nexus 5 (A6.0.1).
I did get the authorization pop-up and confirmed it, despite that Android Studio nor any other IDE could connect to device.
Turned out my Nexus (rooted) was missing key files.
Rebooted Android device into recovery
Ran code pasted below
Rebooted Android device, adb now identifies device
Push key from computer to Android device:
cd ~/.android && adb push adbkey.pub /data/misc/adb/adb_keys
Solution came from here
I was getting this error with my Nexus 10. I tried all of the answers I could find, and then I realized I was using a different USB port than usual. I switched to using the port I usually use, which is on the other side of my laptop, and the authorization popped up on my tablet!
As the message have stated, you need to allow the adb access on your phone.
You need to first connect the phone to your PC with USB cables, then the authorization message will pop out on the screen. Tick remember your choice, then allow it.
IF your device doesnt shows any messages when connected to the PC.Just do this.
Remove /data/misc/adb/adb_key, reboot your phone and try connect
again. The message should come up.
Recheck 'USB Debug' option in developer options helped me
The solution is to copy your file ~/.android/adbkey.pub (on GNU/Linux, or %USERPROFILE%\.android\adbkey.pub on Windows) to Android, and place it as /data/misc/adb/adb_keys. You need root privileges to do that.
You can transfer the file any way you like (or are able to), be it USB, e-mail or a temporary file upload service. In my case, as it was a new Android-x86 installation in a Virtual Machine, no usable web browser, and with network/TCP adb not working, I had to actually type in the 715 characters.
At least it worked.
If you are on ubuntu, try running the server as root:
sudo adb kill-server
sudo adb start-server
Simply, turn off developer options from your device and again turn on, attach USB with the device and working system and turn on USB debugging.
I was tiered with this, I got that permission dialog by turning off wi-fi of my phone.
Disconnect your device from the computer.
Go into developer settings.
Turn off developer settings.
Turn on developer settings.
Enable USB Debugging (and whatever other settings you enabled beforehand)
Reconnect your device to the computer.
Try again.
Worked for me so hope it works for you!
I was not getting the RSA fingerprint pop up on my phone.
I had to go into the
C:\Users\<userName>\.android\adbkey and adbkey.pub
files, delete those and then do kill and restart of adb 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.
This solved my issue!
run your android simulator
go to setting and enable developer mode
enable from the developer settings usb debugging
at this point you will get popup massage at you emulator to authorise the device and you are good to go :)
You should delete the file: c:\users\_user_name_\.android\adbkey
On some Samsung devices the mode change that can be set by dialing *#0808# doesn't stick without direct reboot. Once rebooted, dial the same string and make sure that you have adb + mdp selected and USB set to AP. After this make sure to reconnect phone and restart ADB server. Also try to avoid USB hubs and virtual machines witch surely complicate matter further. The follow the previously mentioned instructions for clearing authorized devices etc.
I had a similar problem. However, it was solved using a different solution. I thought I might share this here as well. Let me describe my problem first.
I had the Android SDK in my ubuntu. The path to the android SDK was not in the environment variable path. I installed adb using a apt-get command and it could not find the sdk home folder and hence, it was showing the unauthorized error and the device was not popping up anything as well. I got stuck here.
Then I uninstalled the adb using apt-get purge which I installed earlier. The Android SDK has the adb program in the platform-tools folder. I just add the path to the environment variable and it worked like a charm.
export PATH=${PATH}:/home/YOUR-USERNAME/path/to/adb
adb devices
List of devices attached
f7f716d56905 device
Hence the problem was not setting the Android SDK to the environment variable path.
The same issue started appearing once I changed my development device, it was solved as:
$ mv ~/.android/adbkey ~/.android/adbkey.old
$ mv ~/.android/adbkey.pub ~/.android/adbkey.pub.old
$ adb kill-server
$ adb start-server
I had the same message in two phones:
- Sony Xperia E
- Samsung Galaxy Core 2
both Android 4.4.2, and i solved it with these two steps:
1.- Updating my adb to 1.0.31, downloading the latest version of Android SDK from SDK Manager
You can check your adb version by typing
adb version
2.- Once the phone is plugged in USB Debugging mode, A message appears asking you to authorize this computer for debugging. You have to mark "Always allow this computer", and click on Allow.
Hope it helps.
it's not may work for all situations but because i used a long cable my device doesnt connect properly and the message wont pop up
change the cable may solve the problem
I just try adb kill-server, it works for me:
PS C:\Users\languoguang> adb devices
List of devices attached
MKJ0117A19000186 unauthorized
PS C:\Users\languoguang> adb shell
error: 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.
kill and start adb server:
PS C:\Users\languoguang> adb kill-server
PS C:\Users\languoguang> adb start-server
* daemon not running; starting now at tcp:12345
* daemon started successfully
PS C:\Users\languoguang> adb devices
List of devices attached
MKJ0117A19000186 device
Here's what I did that that brought the authorization prompt and made my device appear. I used a Samsung Galaxy s7 edge.
Enable developer mode and USB debugging on your device.
Revoke the USB debugging authorization
Plug your phone to computer via USB.
Drag notification panel and select "Software Installation" as shown in the image below
This will begin installing USB driver and the prompt for USB debugging authorization will show.
Check if you have Samsung Kies installed. That is one possible solution
Since I reinstalled Eclipse (simply deleted and downloaded it again) I can't debug my applications on Samsung Galaxy i9001 (with CyanogenMod - Android 4.4.2). It worked fine before reinstallation.
Unplug/plug, Uncheck/check "Debug Enabled", adb kill-server/adb start-server, restart phone/computer doesn't work for me. On the device authorize dialog never appears (but I remember that dialog appeared before reinstallation). I have no idea how to force this authorize dialog to display. There is no abd_key.pub file in .android directory.
When i try read cpu info DDMS says:
[2014-04-15 12:47:06 - DDMS] device unauthorized. Please check the confirmation dialog on your device.
Any ideas? Is it possible to generate keys manually without confirmation dialog?
USB Connection
Wireless Connection
It's likely that the device is no longer authorized on ADB for whatever reason.
1. Check if authorized:
<ANDROID_SDK_HOME>\platform-tools>adb devices
List of devices attached
4df798d76f98cf6d unauthorized
2. Revoke USB Debugging on phone
If the device is shown as unauthorized, go to the developer options on the phone and click "Revoke USB debugging authorization" (tested with JellyBean & Samsung GalaxyIII).
3. Restart ADB Server:
Then restarted adb server
adb kill-server
adb start-server
4. Reconnect the device
The device will ask if you are agree to connect the computer id.
You need to confirm it.
5. Now Check the device
It is now authorized!
adb devices
<ANDROID_SDK_HOME>\platform-tools>adb devices
List of devices attached
4df798d76f98cf6d device
Try forcing ADB to create new keys.
On Linux/OSX:
$ mv ~/.android/adbkey ~/.android/adbkey.old
$ mv ~/.android/adbkey.pub ~/.android/adbkey.pub.old
$ adb kill-server
$ adb start-server
On Windows 10 (thank you, Pau Coma Ramirez, Naveen and d4c0d312!):
Go to %HOMEPATH%\Android\.android\
Look for files called adbkey or adbkey.pub.
Delete these files. Or, if you want to be on the safe side, move them to another directory.
Repeat the above steps in %USERPROFILE%\.android\
Try again
After this I didn't even need to unplug my phone: the authorization prompt was already there.
Ohhh finally I figured it out!
After removing Eclipse directory I installed it into another directory.
echo %ANDROID_SDK_HOME%
has displayed wrong path to sdk directory.
set ANDROID_SDK_HOME "E:\adt-bundle-windows-x86_64-20140321\sdk"
unplug device
adb kill-server
adb start-server
plug device
After these steps, I was able to see confirmation dialog with RSA fingerprint on my phone :)
I run into the same issues with nexus7.
Following worked for fixing this.
Open Developer option in the Settings menu on your device.
Switch off the button on the upper right of the screen.
Delete all debug permission from the list of the menu.
Switch on the button on the upper right of the screen.
now reconnect your device to your PC and everything should be fine.
Sorry for my poor english and some name of the menus(buttons) can be incorrect in your language because mine is Japanese.
I had the same problem. It was resolved by setting "USB computer connection" to "Camera (PTP)" instead of "Media Device (MTP)
I wasted hours on this stupid issue. None of the above solutions worked for me on their own.
I'm running Windows 10. I had an old manual install of the Android SDK as well as Android Studio's SDK. I deleted my manually installed SDK and all my devices stopped working. These were the symptoms:
$ adb usb
error: 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.
as well as
$ adb devices
List of devices attached
id1 unauthorized
id2 unauthorized
id3 unauthorized
To be honest I'm not sure which of these steps got me my Allow USB debugging? prompts back so I listed EVERYTHING for completeness. Goes in order from easiest to hardest. Most people seem to be back on their feet after the first two sections.
Restart ADB
I would perform this after each of the sections below.
adb kill-server
adb usb
Go crazy with developer options
Turn Developer options off and back on
Turn USB debugging off and back on
Revoke USB debugging authorizations. Try this while USB debugging is on and if possible try also when USB debugging is off.
Replug devices
Unplug and replug USB cable into phone.
Switch physical ports on your PC that your USB cable is connected into
Switch physical USB cables you're using to connect your devices
Start rebooting everything
Reboot all your devices and connect again
Reboot your PC
Toggle WIFI on and off
Start deleting things
CAUTION Delete your ~/.android folder. Sometimes this folder can have the wrong permissions which can cause issues. You might want to back this folder up first.
Uninstall all manufacturer specific drivers from add/remove programs. I uninstalled the following (names are not exact)
LG United USB Driver
HTC Mobile USB Driver
OnePlus USB Drivers 1.00
Samsung USB Driver
I also uninstalled all emulators and their respective drivers (optional)
Nox & related drivers
Bluestacks
Genymotion
Erase all Android related environment variables.
Delete %ANDROID_HOME% if you have it set
Delete %ANDROID_SDK_HOME% if you have it set
At this point all my devices magically came to life and started displaying the Allow USB debugging? prompts and connecting properly through ADB. If you've made it this far and haven't found a solution, I am truly sorry you're in this predicament. Make sure you've restarted all devices and your dev machine at the end of all of these steps and connect to a fresh USB port using a new cable.
If that still doesn't work try some of these other SO posts on the subject:
Android ADB device offline, can't issue commands
Can't connect Nexus 4 to adb: unauthorized
How to solve ADB device unauthorized in Android ADB host device?
For me, I firstly unauthorized my device accidentally which I found out later. To revert it back to reauthorise:
Disconnect USB device from laptop/computer
Click 'Revoke USB debugging authorisations' in Developer options.
Disable developer options on top.
re-enable it again.
enable USB debugging
run command 'adb kill-server' on terminal
run command 'adb start-server' on terminal
connect your mobile device to laptop/computer
reauthorize
press like)
Note: if above doesn't work, trying restarting your laptop before connecting again
For reference, I just encountered much the same issue on Linux and had a hell of a time figuring it out. I eventually determined that I had a ~/.android directory that was root owned (thanks to running adb as root, while flailing around trying to figure out other connection problems). Deleting that root owned ~/.android directory resolved the missing authorisation dialog next time I reconnected the device.
It's possible that simply changing the ownership would also have fixed the problem - I'm guessing it was a simple lack of access to the adb key file stored inside that was the root of the problem. I didn't verify that, though, and I'm not going to deliberately break my hard-won connectivity just so I can check ;-)
Steps that worked for me:
1. Disconnect phone from usb cable
2. Revoke USB Debugging on phone
3. Restart the device
4. Reconnect the device
The most important part was rebooting the device. Didn't work without it .
After having spent over an hour going in rounds swearing at Samsung (mostly), Google, and who not, here are my findings, that finally helped me get the device recognized:
On Device:
Set developer mode
Allow USB debugging
Default USB configuration > Select USB tethering
Connect device to PC USB
On PC:
Elevated cmd/ps prompt (maybe not mandatory, but that was my drill)
adb kill-server (precede with .\ in ps)
adb start-server (while device connected) > watch for prompt on device
On device:
Always allow connections from this computer > Yes
On PC:
adb devices gets the following output:
List of devices attached
278c250cce217ece device
Had similar issue on osx and Nexus 5 (A6.0.1).
I did get the authorization pop-up and confirmed it, despite that Android Studio nor any other IDE could connect to device.
Turned out my Nexus (rooted) was missing key files.
Rebooted Android device into recovery
Ran code pasted below
Rebooted Android device, adb now identifies device
Push key from computer to Android device:
cd ~/.android && adb push adbkey.pub /data/misc/adb/adb_keys
Solution came from here
I was getting this error with my Nexus 10. I tried all of the answers I could find, and then I realized I was using a different USB port than usual. I switched to using the port I usually use, which is on the other side of my laptop, and the authorization popped up on my tablet!
As the message have stated, you need to allow the adb access on your phone.
You need to first connect the phone to your PC with USB cables, then the authorization message will pop out on the screen. Tick remember your choice, then allow it.
IF your device doesnt shows any messages when connected to the PC.Just do this.
Remove /data/misc/adb/adb_key, reboot your phone and try connect
again. The message should come up.
Recheck 'USB Debug' option in developer options helped me
The solution is to copy your file ~/.android/adbkey.pub (on GNU/Linux, or %USERPROFILE%\.android\adbkey.pub on Windows) to Android, and place it as /data/misc/adb/adb_keys. You need root privileges to do that.
You can transfer the file any way you like (or are able to), be it USB, e-mail or a temporary file upload service. In my case, as it was a new Android-x86 installation in a Virtual Machine, no usable web browser, and with network/TCP adb not working, I had to actually type in the 715 characters.
At least it worked.
If you are on ubuntu, try running the server as root:
sudo adb kill-server
sudo adb start-server
Simply, turn off developer options from your device and again turn on, attach USB with the device and working system and turn on USB debugging.
I was tiered with this, I got that permission dialog by turning off wi-fi of my phone.
Disconnect your device from the computer.
Go into developer settings.
Turn off developer settings.
Turn on developer settings.
Enable USB Debugging (and whatever other settings you enabled beforehand)
Reconnect your device to the computer.
Try again.
Worked for me so hope it works for you!
I was not getting the RSA fingerprint pop up on my phone.
I had to go into the
C:\Users\<userName>\.android\adbkey and adbkey.pub
files, delete those and then do kill and restart of adb 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.
This solved my issue!
run your android simulator
go to setting and enable developer mode
enable from the developer settings usb debugging
at this point you will get popup massage at you emulator to authorise the device and you are good to go :)
You should delete the file: c:\users\_user_name_\.android\adbkey
On some Samsung devices the mode change that can be set by dialing *#0808# doesn't stick without direct reboot. Once rebooted, dial the same string and make sure that you have adb + mdp selected and USB set to AP. After this make sure to reconnect phone and restart ADB server. Also try to avoid USB hubs and virtual machines witch surely complicate matter further. The follow the previously mentioned instructions for clearing authorized devices etc.
I had a similar problem. However, it was solved using a different solution. I thought I might share this here as well. Let me describe my problem first.
I had the Android SDK in my ubuntu. The path to the android SDK was not in the environment variable path. I installed adb using a apt-get command and it could not find the sdk home folder and hence, it was showing the unauthorized error and the device was not popping up anything as well. I got stuck here.
Then I uninstalled the adb using apt-get purge which I installed earlier. The Android SDK has the adb program in the platform-tools folder. I just add the path to the environment variable and it worked like a charm.
export PATH=${PATH}:/home/YOUR-USERNAME/path/to/adb
adb devices
List of devices attached
f7f716d56905 device
Hence the problem was not setting the Android SDK to the environment variable path.
The same issue started appearing once I changed my development device, it was solved as:
$ mv ~/.android/adbkey ~/.android/adbkey.old
$ mv ~/.android/adbkey.pub ~/.android/adbkey.pub.old
$ adb kill-server
$ adb start-server
I had the same message in two phones:
- Sony Xperia E
- Samsung Galaxy Core 2
both Android 4.4.2, and i solved it with these two steps:
1.- Updating my adb to 1.0.31, downloading the latest version of Android SDK from SDK Manager
You can check your adb version by typing
adb version
2.- Once the phone is plugged in USB Debugging mode, A message appears asking you to authorize this computer for debugging. You have to mark "Always allow this computer", and click on Allow.
Hope it helps.
it's not may work for all situations but because i used a long cable my device doesnt connect properly and the message wont pop up
change the cable may solve the problem
I just try adb kill-server, it works for me:
PS C:\Users\languoguang> adb devices
List of devices attached
MKJ0117A19000186 unauthorized
PS C:\Users\languoguang> adb shell
error: 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.
kill and start adb server:
PS C:\Users\languoguang> adb kill-server
PS C:\Users\languoguang> adb start-server
* daemon not running; starting now at tcp:12345
* daemon started successfully
PS C:\Users\languoguang> adb devices
List of devices attached
MKJ0117A19000186 device
Here's what I did that that brought the authorization prompt and made my device appear. I used a Samsung Galaxy s7 edge.
Enable developer mode and USB debugging on your device.
Revoke the USB debugging authorization
Plug your phone to computer via USB.
Drag notification panel and select "Software Installation" as shown in the image below
This will begin installing USB driver and the prompt for USB debugging authorization will show.
Check if you have Samsung Kies installed. That is one possible solution
I'm trying to run my applications on OMEGA T107 tablet. But adb doesn't see my device. I tried almost everything.
Some of these answers are pretty old, so maybe it's changed in recent times, but I had similar issues and I solved it by:
Loading the USB drivers for the device - Samsung S6
Enable Developer tools on the phone.
On the device, go to Settings - Applications - Development - Check USB Debugging
Reboot O/S (Windows 7 - 64bit)
Open Visual Studio
I think it was step 3 that had me stumped for a while. I'd enabled developer tools, but I didn't specifically enable the "USB Debugging" but.
I tried all the ways listed on the web for a whole day, but I didn't get any solutions. Then, I followed a link and in just two minutes my problem was solved!
By the way, it's for Windows users!
Find out the vendor id of the device from device manager.
To do this, connect the OTG port to the USB port of your computer.
Go to Start Menu and right-click on “My Computer” and chose “Properties”.
Select the “Devices” option which will open “Device Manager”.
Select your device (mostly in USB devices or Other devices) and right-click and choose “Properties”.
Choose the “Details” tab and select “Hardware Ids” from the property dropdown, you can see the hardware id, in my case it was x2207 .
Open android_winusb.inf and add these lines:
;<Device name> in our case I gave MK808
%SingleAdbInterface% = USB_INSTALL, USB\VID_2207&PID_0010&MI_01
%CompositeAdbInterface% = USB_INSTALL, USB\VID_2207&PID_0010&REV_0222&MI_01
Open C:\Users\.android\adb_usb.ini and add the following entry
0x<device id> .. in our case it is 0x2207
Restart ADB by
adb kill-server
adb start-server
Now ADB should recognize the device.
I had same issue, none of the solutions worked for me.
Open Settings Menu -> Developer Options -> USB Debugging should be on
Android 11
Settings -> System -> Developer options -> USB debugging
The normal way to fix this is indeed to restart the adb server :
adb kill-server
adb start-server
then
adb devices -l
should list connected devices
But it possible that it doesnt fix the problem. It appends to me.
I had to disable/enable the debug mode on the device, and then restart adb server.
On Windows it is most probably that the device drivers are not installed properly.
First, install Google USB Driver from Android SDK Manager.
Then, go to Start, right-click on My Computer, select Properties and go to Device Manager on the left. Locate you device under Other Devices (Unknown devices, USB Devices). Right-click on it and select Properties. Navigate to Driver tab. Select Update Driver and then Browse my computer for driver software. Choose %ANDROID_SDK_HOME%\extras\google\usb_driver directory. Windows should find and install drivers there. Then run adb kill-server. Next time you do adb devices the device should be in the list.
Not all USB cables can transfer data. Try using a different USB cable if your device is charging, but doesn't establish a connection to your machine.
Read more: How to tell a USB charge-only cable from a USB data cable - Dignited
What operating system are you on? If you running Windows you will want to make sure you have the drivers. You should also make sure that your Android SDK Manager is not only installed, but it also contains some additional things for different devices. Not sure if yours is in there or not.
Make sure that your phone has debugging enabled. I found myself having to run
adb kill-server
adb devices
often.
On windows, you will need to install drivers for the device for adb to recognize it. To see if the drivers are installed, check the device manager. If there is any "unrecognized device" in the device manager, the drivers are not installed. You can usually get the adb drivers from the manufacturers.
For Windows 8 64 bit with a Nexus 10 device, this worked for me:
https://github.com/koush/UniversalAdbDriver
It has a link at the bottom to this:
http://download.clockworkmod.com/test/UniversalAdbDriverSetup.msi
It worked for me in my Astro Tab A737
Download and install PdaNet+ from http://pdanet.co/a/ in your computer.
follow all steps in the wizard while installing .Once the drivers are installed Android studio should recognize the tablet.
Also, make sure the device is in PTP mode.
Uninstalling all old "Android ADB Interface" drivers that were installed previously and then installing the new one worked for me.
Debugging needs to be enabled on the target device in order for adb to see it.
Intel has a peach of an article on this. It's all the same driver. It's just a Device ID mismatch in the Inf file which can be edited, or Windows forced to Install the driver we point it to. Intel's article is very thorough and takes care of every hurdle you come across. The link - https://software.intel.com/en-us/xdk/docs/installing-android-debug-bridge-adb-usb-driver-on-windows
Keep in mind while you connecting device Android propose to select one of possible connection options.
In my case:
File transfer
Power charging
Media
Not all types of connection will work with ADB. In my case need to select Power charging to be able to connect to ADB
Go to Device Manager
Right-click Android Composite ADB Interface
Uninstall devices
Right-click your LocalPC then select Scan for hardware changes
Your device should be enabled
Open Command Prompt
adb kill-server
adb start-server
adb devices