Device going offline randomly (and appearing multiple times as offline) in Eclipse - fixes?

32,664

Solution 1

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.

Solution 2

Toggle on/off for 'USB Debugging' in settings worked for me.

Solution 3

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

Solution 4

I had a similar problem. I just solved it by plugging in the cable into the usb2 port instead of usb3.

Solution 5

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

Share:
32,664

Related videos on Youtube

Codemonkey
Author by

Codemonkey

Updated on February 22, 2021

Comments

  • Codemonkey
    Codemonkey over 3 years

    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.

    • Reno
      Reno over 13 years
      @Klaus mention the device you are using, it'll be of help.
    • Codemonkey
      Codemonkey over 13 years
      Hnnngh - I had that in my notepad version of the question but apparently missed it somehow. It's a Samsung Galaxy S with Froyo.
    • Kevin
      Kevin over 13 years
      HTC Desire doesn't do this. Although the logcat often starts 'clearing' itself really quickly so you can't see the history. I usually hit the red x to manually clear the logcat and that fixes it for a while.
    • Codemonkey
      Codemonkey over 13 years
      Yeah Kevin, I'm fairly sure that's just LogCat and Eclipse being funky. And it's not fatal, as you mention. This is really annoying me when I'm debugging. I wonder if this has anything to do with the fact that I connect it through a USB hub (our PCs are located in another room, no noise and heat from them) - it still works fine at times though.
    • WarrenFaith
      WarrenFaith over 13 years
      have you tried to use logcat without eclipse? I dismissed the logcat view because its to buggy..
    • Geltrude
      Geltrude over 12 years
      I've the same annoying problem :-( WIN7 64bit + Android 2.3.3 + HTC DESIRE ROOTED
    • wojciii
      wojciii almost 12 years
      If the problem is unstable USB, you could try to use adb over TCP/IP instead of USB.
    • Jon Watte
      Jon Watte over 10 years
      This happens to me, too, with Samsung Galaxy Note 2, ADK v19, and a direct USB connection to the computer. I'm using adb from the command line (using cordova to develop) so it's not at all related to Eclipse or the ADT plug-in. Un-plugging and re-plugging the phone "fixes" it (and is a pain to do every time I want to re-run an app.)
  • Codemonkey
    Codemonkey over 13 years
    Yeah, those are not on. I've managed to get it fairly stable by starting it through adb start-server -> adb logcat -> ddms -> then open Eclipse and monitor it. Eclipse does something funky that screws it up I guess.
  • Codemonkey
    Codemonkey over 13 years
    Disregard the above, this is still driving me crazy.
  • sXe
    sXe over 12 years
    The kill/restart sometimes worked, the switching USB ports occasionally worked, and the restarting the phone always worked (but I didn't like to do it). Seems like toggling the USB Debugging works every time, thanks!!
  • Melinda Green
    Melinda Green over 12 years
    I gave you the bounty on this because it was the closest to my conclusion (USB jack on device, not cable). Sure would be nice to be able to debug on any phone over wi-fi instead, no? :-) Anyway, thanks for your answer.
  • TwainJ
    TwainJ over 12 years
    Thanks! Glad it was helpful! I agree, Wifi debugging would be handy at times.
  • Jon Watte
    Jon Watte over 10 years
    From looking at the various posts about this, I think this is a Samsung value-added "feature."
  • Arpit Garg
    Arpit Garg over 10 years
    @JonWatte If you are using windows environment,go to task manager kill the process "adb.exe" and use the above commands again.
  • kakhkAtion
    kakhkAtion over 8 years
    It won't "definitely" solve the problem! The issue could be something other than the server (e.g. USB cable as others suggested). Also, your solution is in the question and clearly didn't resolve the issue!
  • tricknology
    tricknology over 7 years
    Haha, It was the cable. Thanks!
  • TwainJ
    TwainJ almost 7 years
    I'm amazed at how useful this answer has proved for people over the years (!) - for a small-time SO user like me, anyway. So just a bit of info I found awhile back regarding all that "internal" stuff that I still don't profess to know. There is an Amazon reviewer named Benson that does all things USB cable. Check his reviews: amzn.to/2r1WjQq I was astounded how much there is to know.