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.
I initially encountered the same problem (with ADB/fastboot downloaded from GitHub), but I eventually got it to work. What worked for me:
I'm surprised to find my solution wasn't listed here.
For me, I have an LG G3. The phone must be connected using LG's driver. I went to
Device Manager > uninstall MTP Driver
and immediately adb worked without 1 sec literally.
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:
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.
Restart the device. I tried everything listed here to get my HTC phone (running Android 4.0.3) working, but
adb devices
kept saying it was offline. After I restarted the phone, it was finally online. Some of the other suggestions here may have contributed to the phone being recognized, but doing a few restarts along the way as you're trying them out certainly won't hurt.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.
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.