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
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
I have connected some android devices to a Linux host. and when I run
adb devices
it will show unauthorized device. I fix this problem by
adb kill-server
sudo adb start-server
but every time the host restarts it will again show device unauthorized. please can someone explain how to fix this problem permanently.
The device is connected to the host through the USB cable.
This seems to be an issue with ADB version.
You may need to update your ADB.
Check using the follow, If older version, update to the latest.
$ adb version
Android Debug Bridge version 1.0.31
When you type:
$ adb devices
List of devices attached
TA93300ZP0 unauthorized
and you should get below notification on your phone
Select Ok, and then when you issue
$ adb devices
List of devices attached
TA93300ZP0 device
You should be able to connect to your device.
If you select Always allow from this computer.
This should fix your problem permanently.
Tested on Moto G (Android 4.4.4) on Ubuntu 12.04.
Kill the adb server , Removing the .android folder from my user (ex. C:\Users\user.android on Win7) folder as well as unplugging and "revoking USB debugging authorization..", and then plug back in, I finally got the fingerprint to show up again.
You should get the Allow USB debugging prompt. If for some reason you don't get it, disable debugging and re-enabling debugging will fix it.
Go into the Android's Debugging options screen. Disable debugging, then re-enable debugging. Then try again to connect using adb. Now the authorization prompt will pop up on the Android. You'll see:
Allow USB debugging? And the computer's RSA key finger print.
You'll also have a checkbox option to Always allow this computer.
Answer the prompt giving permission. You can also check the option to always allow this computer.
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 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?
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.
I solved this problem without deleting any keys. Here's how:
My device was connected to my computer via USB
I made sure Eclipse and android device monitor weren't running.
Typed at the commandline prompt: adb kill-server
Typed at the commandline prompt: adb start-server
After adb was restarted, I got a prompt on my device to authorize which I allowed.
С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
(on device) Settings -> Developer Options -> USB Debugging -- switch off and on
[Windows] Make sure you have the proper driver (your best bet is Universal Adb Driver by Koushik Dutta -- will handle any device)
[Windows] Try turning off all fancy on-the-fly anti-malware scanners/firewalls
[Linux] Make sure you have the proper UDEV rule in /etc/udev/rules.d/51-android.rules (again, universal solution: https://github.com/snowdream/51-android)
[Linux] Make sure everything under ~/.android is owned by you, not root (and upvote this answer)
restart device (yes, surprisingly, this is a valid measure, too)
(Obviously) replug cable, try different cable, different port, remove any extender cables
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;
I sent the public key (adbkey.pub in ~/.android/) from my computer to my device via email;
Invoke stop adbd;
cat adbkey.pub >> /data/misc/adb/adb_keys (authorize myself);
start adbd (restart adb with new keys).
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!
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.
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
Four easy steps
./adb kill-server
./adb start-server
replug the device, unlock it and accept the new key
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:
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:
Reboot your phone into recovery mode.
Connect it to your computer.
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!
Here is my version of the steps:
Make sure adb is running
In device go to Settings -> developer options -> Revoke USB debugging authorities
Disconnect device
In adb shell type > adb kill-server
In adb shell type > adb start-server
Connect device
if adb shell shows empty host name, restart device
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.
Make sure adb is up to date
Make sure you are using the google usb drivers: http://developer.android.com/tools/extras/oem-usb.html
Make sure your ANDROID_SDK_HOME environment variable is set to the correct path
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.
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.
For me once I disabled MTP (in Settings>Storage>Menu>MTP) I finally got the RSA prompt
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.
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.
Go to Settings
Tap on Storage
Tap on 3 dots in the top right
Tap on USB Computer Connection
UNCHECK MTP
UNCHECK PTP
Back in your console, type adb devices
Now you should get the RSA popup on your phone.
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
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.
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.
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.
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.
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.
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 !
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.
I can't connect to my device anymore using ADB through the command line or in Eclipse.
Running the command
adb devices
returns the device name, but it says it's offline.
Things I've tried.
Toggled Android debugging mode
Reinstalled the Google USB driver
Restored the OS to a previously working backup (CyanogenMod)
Swapped the USB cord
Rebooted the phone/computer multiple times
Updated the Android SDK
I really don't have any clue what's going on. Anything else you think I can try, I'm all ears.
To be clear, if you're having this same issue the problem is probably an out-of-date SDK. As of 4.2.2 there is a security feature that requires you to confirm the RSA fingerprint of the connecting device. Open the SDK manager and update the tools! Then reboot.
Just kill the server adb kill-server
I just got the same problem today after my Nexus 7 and Galaxy Nexus were updated to Android 4.2.2.
The thing that fixed it for me was to upgrade the SDK platform-tools to r16.0.1. For me, this version was not displayed in my SDK Manager, so I pulled it down from http://dl.google.com/android/repository/platform-tools_r16.0.1-windows.zip directly.
You then need to rename the platform-tools directory and unzip it to android-sdk-windows/platform-tools. Using the SDK Manager, I had also updated to the latest sdk-tools before this.
If your whole Eclipse and ADT are ancient, you may need to update them as well, but I didn't need to.
Note: you may need to run SDK Manager twice (once to update itself) before you will see the latest packages.
It also seems to occur frequently when you connect to the device using the Wi-Fi mode (in Android Studio or in the console by running adb tcpip 5555 for example).
To fix:
Disconnect the USB connection—or turn off the device's Wi-Fi if you're connected over Wi-Fi.
Close Android Studio/Eclipse/other IDE.
Run adb kill-server to ensure adb is not running.
Restart your Android device.
After your device restarts, connect it via USB and run adb devices. This should start the ADB daemon. Your device should now be online again.
I hit the same issue on a Nexus 7 running 4.2.2 OTA update. I'm almost certain I had an ADB connection over USB and Wi-Fi after the update until it just stopped working. To fix, I updated my SDK using:
android update sdk --no-ui
Now my development tools are:
SDK rev 16.0.2
SDK tools rev 21.1
SDK API 17, rev 2
I can't stress that switching USB ports is key. Often front panel USB ports can be defective.
For anyone wondering about 4.2.2, there is a security question that appears on the phone requesting RSA verification with the PC. Be sure your tools are updated AND you allow the PC access by verifying the security question on the devices in question. This fixed it for me.
And as always, verify you have debugging enabled in the developer options ;)
Try by turning off usb debugging once and then enabling it agin and then connect your device with system: link
Multiple adb.exe files ?
My problem was solved when deleted a copy of OLD adb.exe from C:/Windows/.
I don't know how a copy of adb.exe got to the C:\Windows\ ?
When I launch adb.exe from android-sdk/platform-tools/ I had no problem with detection.
If your device normally connects over USB, but suddenly stops working, especially after the USB cable has been disconnected and reconnected, try the following non-invasive steps before doing some of the more drastic things mentioned in the other answers:
adb kill-server
adb start-server
adb devices
If your device is listed with 'device' next to it, you're back in business.
If your device is listed with 'offline' next to it, try restarting the device. The ADB daemon on the device will occasionally get hung. I've noticed this more when I've disconnected the cable while LogCat is running and after switching back from connecting via Wi-Fi or Ethernet.
If your device isn't listed then you should try the solutions in the other answers, starting with trying a different USB cable and port. Those cheapo cables can go bad.
I was having this problem and none of the other answers helped. What was necessary, after updating the SDK and installing the API for 4.2.2, was running:
android update adb
Another problem I was having was that I was trying to connect ADB over Wi-Fi, which is my only option because the USB ports on my Mac are really finnicky. Unfortunately, ADB over Wi-Fi doesn't show the security question in 4.2.2, so you need to find a USB cable that'll work and connect over USB at least once to accept the security question, but after you do that once, you can connect over Wi-Fi.
Be sure to use adb from your platform-tools folder, after updating the SDK tools.
I finally got this working after I realized I was using an outdated version of ADB copied in /usr/bin.
I ran to through same problem this fixed for me. connect your phone via usb first then make sure you check your mobile ip which is under settings >> about phone >> status run the following commands.
adb kill-server
adb start-server
adb tcpip 5555 //it resets port so put port you want to connect
adb connect 192.168.1.30:5555 //ip:port of your mobile to connect
adb devices //you will be connected over wifi
Sometime this may happen because of adb server error (i think). It always saying
"device-name is offline" from adb devices command.
Just kill server and start again. It worked for me.
"adb kill-server"
"adb start-server"
I used adb connect <device_ip> and non of the other solutions worked because my problem was on the other side. On the device I needed to stop adbd and restart it start adbd. Device is now "online" again.
I stumbled upon this question while trying to connect using the built in "Wireless ADB" feature present in Android 11.
I couldn't get it to connect properly. Always appeared as "offline".
What I did was following:
Firstly disconnect all ADB devices, just as a good measure:
adb disconnect
Then in the developer options, get into the "Wireless ADB" feature, if you're not already there yet. Go to "Pair using PIN" or similar. There, a IP and port will pop up in a dialog, together with a pin. Connect to the phone using:
adb pair 192.168.2.xxx:42838 # Put the IP and port of that dialog in this way
(Note that the port on the main window and on the PIN popup is NOT the same)
Your (PC) ADB will prompt you for a pin. Type it in and press ENTER.
Done that, the PIN popup on the phone should vanish and the computer name should show up in the trusted device list in the main window.
If you come this far, the next step will certainly work. Try to now connect to your phone using:
adb connect 192.168.2.xxx:53548 # This time use the port shown in the main window!
It should connect and you're good to go.
I tried dturvene and all the other solutions, but they didn't work. I needed one more step.
Run these commands
adb kill-server
android update sdk --no-ui
adb start-server
To verify that it worked, run 'adb version' before and after the commands and make sure it is the latest. The reason for the adb kill-server command is that it it most likely running, and it can't be updated while it is running, so you have to kill it first.
Installed the latest android sdk.
Changed the USB port of the device.
Changed from MTP -> Charge only -> MTP.
It worked.
For me nothing worked. I spent about 12 hours constantly searching on the Internet and trying the solutions that worked for other people having similar issues.
Finally I ended up with just doing the ADB stuff over the LAN. The setting was right next to the USB Debug setting and in ADB it can be activated with "adb connect [IPADDRESS]:[PORT]". The port was 5555 on my phone.
I hope this helps someone to get back to work instead of having to deal with constant drawbacks.
This approach worked for me:
adb kill-server
Disable the offline device in Device Manager (see image below)
Enable the device in Device Manager
adb start-server
Device Manager, "View" menu, "Devices by Connection":
I initially encountered the same problem (with ADB/fastboot downloaded from GitHub), but I eventually got it to work. What worked for me:
Android SDK. ADB version: 1.0.31
Using the front USB port (MacBook Pro 15")
Restarting the phone after enabling Dev options and USB debugging (do so by 7x tap on settings > about phone > build).
Kill adb server in case no device is listed (adb kill-server)
The debug icon should be visible on the phone.
Be sure to unlock lock-screen to check for the RSA fingerprint confirmation dialog.
One more possibility for people with flaky ADB connections, and if they're on a Mac and have Android File Transfer installed: I found that file transfer was interfering with my ADB connection, causing it to stop working intermittently.
Killing the Android File Transfer Agent.app process that looks for compatible devices (for example, the Nexus 7) being connected to the Mac cures the flakiness for me.
If you've previously authorized the RSA fingerprint of your PC and tried adb kill-server etc. with no luck, your problem might just be that you're trying to connect to it while it's locked. Try pressing the screen-on button and entering your pattern - this fixed it for me.
The best way I figured is by disabling and then enabling the device from Device Manager and running the adb devices command.
Go to the start tab and right click on Computer
From the drop down menu, click Manage
From the computer management screen, click Device Manager
On the right pane, expand portable devices to find your device
Right click on your device name and click disable on the drop down menu
When it gets disabled, repeat step 5 except for enabling it.
The device will be back online. It's faster.
As nobody gave an answer for my situation: you may not have access to the ~/.android/adbkey file. If you initially start adb with sudo, it will generate a public key pair, writing this to ~/.android/adbkey.pub and ~/android/adbkey. Of course, the private key is chmod 600 - only readable for root in your home directory. Subsequently starting adb as normal user will give no access to the private key file, which in turn will fail silently with "device offline".
What solved for me on Mac was updating adb to the latest version (1.0.32). Now i can see my device online again
The reason for a device to be reported as offline is that adb can not connect to it. Adb executable from the development environment creates a connection (socket) with the device under control. The device has a service (daemon) that listens for this communication. The daemon is called adbd (as in adbdaemon).
When one enables adb on a device in fact one starts this daemon, so comms can be established with the device.
When the device is reported by adb as offline is because the daemon is not running anymore or is in a state that will not accept connections. Most often than not this happens if the network goes down on an active (network) connection.
The only way that I could fix this was by rebooting the device.
One can arrive to fixing the offline status by many other means but restarting the device always works.
When I am facing the same issues than doing like below:
Restart adb by issuing adb kill-server followed by adb start-server in a command prompt
Disable and re-enable USB debugging on the phone
Rebooting the phone if it still doesn't work.
99% of my issues have been resolved with these steps.
I have a dodgy USB connection so I tried to get wifi connectivity going. Tried basically everything here, but one thing I did not try until last, and suddenly it worked! So, if you end up stuck, try these steps:
1. Connect with USB cord
2. adb devices
List of devices attached
HT85X1A00342 device
10.0.0.43:5555 offline
3. adb usb
restarting in USB mode
4. adb reconnect
reconnecting HT85X1A00342 [device]
5. adb tcpip 5555
restarting in TCP mode port: 5555
6. adb devices
List of devices attached
7. adb connect 10.0.0.43:5555
connected to 10.0.0.43:5555
Sweet! I don't know exactly if forcing it to restart USB mode then TCP/IP in sequence helped, or just the last three commands, but clearly it started working. I also found there's a Developer Option to Enable Debugging on Wifi, and you select your hotspot. That may also prevent it working, so check that as well.
Good luck!
I tried all of the solutions above. Mostly, adb kill-server would solve the problem. This time, the problem was in USB cable. Poor quality cables in fancy packing don't work.
It's just because your computer doesn't have the right driver. To fix that:
Download and extract Android SDK
Go to Device Manager (Right Click on Computer --> Properties --> Device Manager
On the right pane expand portable devices to find your device
Right click on your device name and click Update Driver Software
Browse my computer for driver software
Browse to your Android SDK folder on step 1.
Next and you're done