Device going offline randomly (and appearing multiple times as offline) in Eclipse - fixes?
This problem has been bugging me for ages and I can't seem to fix it or fully localize the source of the problem (although at times I can force it by allowing the phone to Standby while connected to Eclipse, but sometimes that doesn't even cause a problem).
Let's go through the steps.
I connect my device, it pops up and seems to be working fine:
I double-click it to ensure LogCat is logging it at which point 1 of 2 things happen:
It seems to work, I swap to LogCat window which sliiides through a bunch of text and then goes white, I swap back to Devices and see
Device goes offline immediately
Now if I leave it for a while and do random things around Eclipse, the number of offline devices slowly increase (they all have the same ID, mine):
Things that help:
I have Googled and looked at other questions regarding this and only managed to find a few "guides" that tell me to restart the adb server. I've done that through the use of the commands:
adb kill-server
adb start-server
The problem is, that only fixes it very rarely. At times a complete PC reboot will fix it, but not always...
Also, turn off Standby mode on your phone when it's plugged in. For me, this is achieved by going
- Settings -> Programs -> Development -> Stay Awake
Does anyone have a true solution for this? I've tried most of what I could find on Google and had zero luck yet and it's really starting to annoy me.
EDIT: Holy crap, this is SO ANNOYING! EDIT 2: Adding a bounty to this as soon as I can.
EDIT 3: Probably related to the fact that it's connected through a USB hub as our machines are located in another room to keep noise & heat levels down in our offices. I have gotten it stable enough to deploy applications and test very quickly, but it still goes Offline at times. Oh well, done with my project for now.
I was just tinkering around at home with some development, and started noticing this behavior for the first time. After reading through the suggestions (USB plugs in particular), I got to thinking that the USB cable I had at hand is pretty wimpy looking, so I grabbed the cable I normally use for work (it's a larger diameter, I don't know, what that means internally), and since then everything has been working fine.
So for anyone landing here with these troubles, you might also check to make sure it isn't the USB cable.
Toggle on/off for 'USB Debugging' in settings worked for me.
My case is...
Nexus-4, Android version. 4.2.2
Because of Security Enhancements in Android 4.2.2, my device was offline.
Android 4.2.2 introduces secure USB debugging which when enabled ensures only host computers authorized by the user can access the internals of a USB connected device using the ADB tool included with the Android SDK.
Update your SDK, accept the RSA key on your phone.
Here is some references.
http://www.infoq.com/news/2013/02/android-4-2-2
http://www.androidcentral.com/semi-pro-tip-android-422-here-your-android-sdk-might-need-updating
I had a similar problem. I just solved it by plugging in the cable into the usb2 port instead of usb3.
If your platform and platform-tools path is set:
Then from command prompt:
adb kill-server
adb start-server
It will definitely solve the problem as it restarts the daemon with the specific port