13

When I debug my Android app on a device it just sits at Waiting for device endlessly. There is nothing in the log to say that something is awry. It works perfectly the first 1 or 2 times then simply cannot reconnect with the phone.

I have tried this with the following phones:

  • Samsung Galaxy S1
  • Samsung Galaxy Nexus
  • HTC Sensation.

All phones were in USB Debugging mode and have tried with Mass-Storage on and off.

Any suggestions?

Alex P.
  • 30,437
  • 17
  • 118
  • 169
CodeMonkey
  • 1,426
  • 1
  • 14
  • 32
  • Also just noticed that when the phone is unplugged and I debug the app, the phone still shows up in the 'Select Device' screen... – CodeMonkey Mar 15 '12 at 01:08

4 Answers4

19

If you run 'adb devices' from the command line, I assume you get no devices. Does disconnecting the cable and reconnecting it fix the problem?

Have you tried 'adb kill-server' followed by 'adb devices' to restart it? That should help narrow down if it is adb vs your phones causing the problem (although I've had to kill every instance of adb sometimes, where several seem to have been spawned).

ProjectJourneyman
  • 3,566
  • 1
  • 27
  • 37
  • 1
    Thanks for the quick reply JourneyMan. I ran adb devices and it listed my latest device (Samsung Galaxy) about 40-50 times with the status 'disconnected'. I then ran adb kill-server and adb-devices and got a whole stack of prompts for "timeout waiting for device" which points pretty firmly toward some kind of error in the management of running devices! Plug in phone, re-run debug and BAM! Working again! Thanks for the fix mate, very grateful. – CodeMonkey Mar 15 '12 at 02:43
  • 1
    Worth noting, I've had this happen before and it took a slightly different fix. I had to turn debugging off and back on in my phone settings before it worked again. This was with my HTC EVO 4G. – HotN Sep 10 '12 at 21:45
  • I have an HTC EVO 4G too. I just restarted Android Studio, after trying disconnecting the cable and restarting the phone. Restarting Android Studio worked! – Sterling Diaz Nov 24 '13 at 19:10
4

Try

  1. disconnect phone
  2. "adb kill-server"
  3. "adb start-server"
  4. reconnect phone
Kijewski
  • 25,517
  • 12
  • 101
  • 143
Kai
  • 15,284
  • 6
  • 51
  • 82
0

I've been having this issue with a Samsung Galaxy SII, and the problem went away completely when I stopped using my USB3 port.

Using the USB2 port on the same machine, it hasn't hiccuped once. On the USB3 port, it flakes out in 10-15 seconds, requiring me to reattach it and start over.

Kai Arnold
  • 121
  • 1
  • 5
0

Are you using a USB splitter/hub like this? Using a normal USB port fixed the issue.

enter image description here

Mick
  • 30,759
  • 16
  • 111
  • 130