Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse/adb frequently disconnects from my device

Tags:

android

While debugging, my device frequently disconnects from my PC, usually after every debug session. The device still appears in the DDMS list but the status is "offline". The only way to fix it is to reconnect the USB cord, which becomes a pain after doing it 10 times every hour. There are no visible error messages when it happens.

I thought it was a physical connectivity problem with my USB cord or my device, but I recently upgraded to a brand-new Galaxy Nexus with a brand-new USB cord and it still happens. Now I'm convinced it's a software issue.

Is there any reason why my devices goes offline frequently? Are there any programs that are known to interfere with the Android/ADB connection?

like image 666
Barry Fruitman Avatar asked Apr 27 '12 17:04

Barry Fruitman


3 Answers

Yup, you are right. It seems to be a software issue.I have faced this annoying thing many times, it happens now and then. I think what happens is that the adb's connection with the device/emulator breaks or becomes faulty, so android starts showing the device as offline.

To correct this problem. Go to DDMS-->Devices Tab-->Click the option "Reset adb" (which is the last option, on clicking the dropdown arrow) . You will then see some error report in the console, but after a minute your emulator would be ready to be used without problems. I do it all the time and it works. Try this instead of manually plugging/unplugging the device.

like image 81
Akhil Avatar answered Nov 20 '22 09:11

Akhil


Please check this answer https://stackoverflow.com/a/26425489/1200583 that is for mac but maybe is the same for other OSs

enter image description here

like image 37
elin3t Avatar answered Nov 20 '22 07:11

elin3t


I find it faster to just plug/unplug, but doing the following in command-line should do the same thing:

adb kill-server
adb start-server
like image 5
josephus Avatar answered Nov 20 '22 07:11

josephus