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.

ninesided
  • 23,085
  • 14
  • 83
  • 107
pharaoh
  • 313
  • 1
  • 3
  • 15

9 Answers9

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.

Rodney Lambert
  • 707
  • 6
  • 7
  • 1
    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). – Pointer Null Dec 05 '11 at 22:09
  • 1
    if it returns ??????????? you have to add udev rules, question was about missing at all after a while. – logcat Dec 07 '11 at 07:38
  • 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 Windows – Andy Weinstein Jan 31 '12 at 10:20
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.

grouser
  • 618
  • 8
  • 23
  • 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 Fedora – conor Feb 24 '16 at 13:10
  • 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" tab – Mario Jan 22 '20 at 19:02
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

Lalit Poptani
  • 67,150
  • 23
  • 161
  • 242
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.

Aravinda
  • 126
  • 1
  • 5
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.

Greyson
  • 3,598
  • 1
  • 21
  • 22
  • 1
    Does not work that way. I've tried. Up for new answer version. – logcat Dec 07 '11 at 10:20
  • Have you been able to make it happen on a different computer? With a different phone? It might be a combination of USB quirks. – Greyson Dec 07 '11 at 10:23
  • 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. – Greyson Dec 07 '11 at 10:24
  • It does related to linux only, and my experience only for gingerbeard phones(stock & cyanogen 2.3.*), 2.1 htc legend works fine. – logcat Dec 07 '11 at 10:37
  • 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! :) – smheidrich Sep 19 '15 at 19:22
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.

Fran Marzoa
  • 4,293
  • 1
  • 37
  • 53
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

Ruzard
  • 1,167
  • 3
  • 16
  • 33
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.

Lamloumi Afif
  • 8,941
  • 26
  • 98
  • 191
Koushik
  • 21
  • 1
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)

Aurelian Cotuna
  • 3,076
  • 3
  • 29
  • 49
  • 1
    I have allready tryed that, i issue the command $adb kill-server;adb start-server;adb devices and it returns a empty list. – pharaoh Oct 09 '11 at 21:31
  • Are you sure that is not a device problem? Did you turn on "USB Debugging" on your device after you plug it back in? – Aurelian Cotuna Oct 10 '11 at 07:40