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.
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.
Try running
adb devices
after runningadb kill-server
. Security question pops up after that. Worked for me.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:
adb kill-server
to ensure adb is not running.adb devices
. This should start the ADB daemon. Your device should now be online again.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".
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 toandroid-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.
What solved for me on Mac was updating
adb
to the latest version (1.0.32). Now i can see my device online again