Adb stops detecting my phone after a while
Asked Answered
U

9

16

I am developing for android on a linux machine and I have already created a udev rule for android and it works. After a while if I unplug the device and plug it back in again, adb doesn't recognize the device if I run lusb or dmesg to get information about the device. I tried reload the udev rules and it does not work, I even tried to kill the adb process but it still does not work.

Can someone help? Anyway, thank you.

Undaunted answered 5/10, 2011 at 7:45 Comment(0)
B
9

This appears to be a real problem on linux, at some point in time a device will no longer be seen by the ADB. What I should really say is almost never be seen by the ADB. In my case I have a Samsung Galaxy Tab 10.1 that was given to attendees of Google I/O 2011. My Ubuntu 10.10 development system was working just fine with this device. Sometime near September 19th the ADB stopped seeing the device! In fact there have been breif moments in time when the device was detected by the ADB. What needs to be made clear about the problem that I and I believe pharaoh are having is not the permissions issue where executing

$adb devices

returns ?????????? for a device. The device simply does not show up in the list. One more important fact is that at no point in time has this device not been detected on my Windows based development machines.

It appears to me that the mechanism that the ADB uses to determine if a device on the USB is in fact a adb_device is fragile and some change in either our devices or our development systems has broken this detection.

Brainwashing answered 28/10, 2011 at 16:6 Comment(3)
FYI, this happens regularly also on Windows. ADB reports various errors - device disconencted, connection closed, etc etc. My solution: unplug device and plug it back, and restart ADB in Eclipse's devices view. This in most cases works (for another hour).Knucklehead
if it returns ??????????? you have to add udev rules, question was about missing at all after a while.Venicevenin
yikes - i just started getting this too. sigh. and linux was looking to be so promising as it is so much faster building our project in Eclipse under Linux as compared to WindowsRemunerative
P
4

Due to some reason sometimes adb gets disconnected, so in that case you have to restart the adb.

Go to DDMS->Devices and you will see Reset adb option in View Menu besides Screen Capture option.

enter image description here

Passed answered 5/10, 2011 at 8:6 Comment(0)
W
4

I usually have this problem due to I have installed the adb plugin on Chrome. If I close Chrome and re-connect the device, it appears listed with adb. Hope this helps.

Waldon answered 8/1, 2016 at 16:16 Comment(2)
This worked for me! Closed chrome, adb detected the device immediately without requiring a restart. I've been having this problem for a while and I had no idea Chrome was causing it.. FYI I'm on FedoraClaar
That was my case too. Killed the chrome process and adb found the device. My chrome has no adb plugin and I'm not sure yet but I think that the problem stops occurring when you uncheck "Discover USB devices" at a "chrome://inspect" tabKristianson
S
3

I just had this problem as well with my OnePlus 2.

It was working the previous day. I had then set up port-forwarding using the 'device inspector' dialog in Chrome DevTools. It's supposed to be kept open for it to work, so I kept it open in a tab permanently.

The next day when I connected my device via USB, adb devices didn't list anything. I closed the device inspector dialog in my devtools and suddenly adb recognized my device again. I re-enabled port forwarding after this, but my device is stll being detected.

tl;dr: Close your port-forwarding dialog in Chrome DevTools if it had been kept open even after you removed your device.

Stubbed answered 3/12, 2016 at 5:42 Comment(0)
L
2

I've had this happen before. I disable, and then re-enable debugging on the phone (Setting -> Applications -> Development -> USB debugging, uncheck, then re-check) to get it recognized by adb again.

Leaguer answered 7/12, 2011 at 10:8 Comment(5)
Does not work that way. I've tried. Up for new answer version.Venicevenin
Have you been able to make it happen on a different computer? With a different phone? It might be a combination of USB quirks.Leaguer
Also, I've noticed that my Nexus S will shut down USB if I let it sleep while it's connected; it's probably also not related, though.Leaguer
It does related to linux only, and my experience only for gingerbeard phones(stock & cyanogen 2.3.*), 2.1 htc legend works fine.Venicevenin
There probably are a couple dozen different root causes for the problem described in the question above. So while this answer obviously won't work for everyone, it did work for me. Thank you very much! :)Marrilee
G
1

Try adb kill-server to stop the adb and use another command 'adb devices' to restart it. It should work and it should detect your device again. ( For those who can edit my post: any other commands will start the server not just adb start-server, so don't edit without to leave a comment at least)

Gynaeco answered 5/10, 2011 at 7:48 Comment(2)
I have allready tryed that, i issue the command $adb kill-server;adb start-server;adb devices and it returns a empty list.Undaunted
Are you sure that is not a device problem? Did you turn on "USB Debugging" on your device after you plug it back in?Gynaeco
D
1

May be stupid, but I have been had similar problem right now and after an hour I noticed that the problem was that my USB hub, in which such devices are connected, were not actually connected to the PC.

In fact, the USB wire WAS connected, but they may not being doing good contact for some reason, so it failed randomly from time to time.

Distant answered 13/9, 2012 at 13:13 Comment(0)
N
1

Same problem here, using mac os. However connected devices are recognized by Android File Transfer application. It all started with S3 phone (rooted), I thought something wrong with the phone, because Nexus 7 (stock) worked as intended. After 3 days of connecting/reconnecting it stopped being recognized by adb too. Tried to perform a hard reset - didn't help.

adb list - empty list

android file transfer - works perfectly

I'll run out of devices soon

Naiad answered 3/9, 2013 at 0:10 Comment(0)
R
1

Same problem observed on ubuntu, I tried the following and it worked:

Reference: link

Use the command udevadm from the above reference for ex:

"sudo udevadm test --action="SUBSYSTEM=="usb", ENV{ID_VENDOR_ID}=="[vendor_id]", ENV{ID_MODEL_ID}=="[model_id]" MODE="0666", SYMLINK+="[Device_Name]"" $(udevadm info -q path -n /dev/bus/usb/001/[DevNum])"

This seems to fix some link files and that solved the problem of adb not detecting device after a while.

Ry answered 9/1, 2014 at 22:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.