Android – Device going offline randomly (and appearing multiple times as offline) in Eclipse – fixes

androiddeviceeclipse

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:

http://i56.tinypic.com/tarkwl.jpg

I double-click it to ensure LogCat is logging it at which point 1 of 2 things happen:

  1. 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

  2. Device goes offline immediately

http://i56.tinypic.com/1z6zakj.jpg

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):

http://i55.tinypic.com/2hzgv35.jpg

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.

Best Answer

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.