87

I am using the Android plugin for Eclipse, and when I try to run my program using a real device through the Android Device Chooser, my phone is not listed as a device. I have updated Eclipse, all of the Android packages, and the USB driver, but it still isn't showing up. My phone is running Android 2.1, which is also the target version listed in the Eclipse project.

Also it happens that the device shows up as an unknown target and the serial number as question marks as shown in the screenshot.

Android Device Chooser

JJD
  • 44,755
  • 49
  • 183
  • 309
Subrat
  • 3,718
  • 6
  • 34
  • 48
  • 2
    I'm on a mac, I have the same problem. – Yevgeny Simkin Sep 17 '10 at 06:18
  • @JJD your edit assumes that the OP had the issue on Linux and not Windows. – Joe Dec 12 '12 at 19:15
  • @Joe That's correct. I had to weigh the advantage of a visual description of the error and the problem to present it platform neutral. I decided the first does help more then the latter distructs. The screen is similar on either OS. – JJD Dec 12 '12 at 21:49

19 Answers19

98

Did you try from your command line (assumed linux)

adb devices

If you got a lot of question marks

List of devices attached
??????????????    device

Check what is the vendor ID of your device:

lsusb 
> Bus 003 Device 006: ID 04e8:689e Samsung Electronics Co., Ltd 

Vendor ID is '04e8' in this case.

You need to add your device to USB list

sudo vim /etc/udev/rules.d/51-android.rules

and put this line (use your own vendor ID).

SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666"

Alternatively try the following syntax as pointed out by mcordaro and Yekmer Simsek referring to the documentation

SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev"

save it, and then

sudo chmod a+r /etc/udev/rules.d/51-android.rules
sudo service udev reload

and it should work now.

yprez
  • 13,376
  • 10
  • 52
  • 70
vsm
  • 3,335
  • 2
  • 23
  • 35
  • 3
    I had the problem with "????????" showing up in my devices list. This fixed it. Thanks! – loneboat Apr 09 '11 at 04:21
  • You're a GOD , man !!!!! For all Samsung devices this is what should be there: SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666" – Hendy Irawan Aug 30 '11 at 12:42
  • For me the command "lsusb" returns an error (command not found) and how do you save the line [SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666"] once you wrote it ? Thanks ! – Regis_AG Oct 27 '11 at 14:45
  • Check vim command, meantime type ":wq" and hit return (without quote) and it should be saved. – vsm Oct 28 '11 at 22:33
  • 10
    I don't know why, but this answer didn't help me. I have HTC Desire, Debian Squeez, Eclipse Galileo and Android 2.2 api installed. I did everything what You wrote here but I have no success, if I do this 'adb devices' I get that: `marek@deb42:~$ adb devices`\n `List of devices attached `\n `???????????? no permissions` – Marecky Dec 19 '11 at 23:33
  • Plase past your lsusb result. – vsm Dec 23 '11 at 03:24
  • 3
    This worked, but I had do sudo adb kill-server before the change was registered. – Khalos Feb 26 '12 at 21:12
  • 2
    Also, remember to restart eclipse after udev reload. – MigDus Sep 14 '12 at 01:30
  • 13
    Hi on ubuntu your answer has worked for me but with a little synthax change for rules file worked. i.e. For HTC this rule has worked SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev" it is told here http://developer.android.com/tools/device.html#setting-up thanks for help – Yekmer Simsek Sep 30 '12 at 12:33
  • 1
    @Marecky, if after this changes this not works, you coulf try doing sudo ./adb kill-server sudo ./adb devices And after it you can use: ./adb devices (without root privileges) Enjoy :) – sgroh Oct 02 '12 at 19:58
  • 1
    In addition to restarting the ADB server, you may have to unplug and plug your device to get it to register. – fouric May 09 '13 at 05:06
  • the second line worked for me on an LG Optimus G e970, eg: `SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666", GROUP="plugdev"` – Ron E Nov 02 '13 at 21:53
  • 2
    Thank you ... BTW try disconnecting the device before the udev service reload - I am using virtual Ubuntu and it worked only when the phone was disconnected – zajac.m2 Jan 07 '14 at 14:53
  • I've done this before for phones, and it works. However this doesn't work for me on a 64 bit Ubuntu Machine for Google Glass Specifically – Tabrock Aug 12 '14 at 19:46
  • @zajac Great solution. I struggled 2 hours to get this but because of your trick it worked like a charm. Thanks. – Programmer Oct 31 '14 at 11:47
  • This must be the BEST ANSWER – P Ravikant Nov 27 '14 at 07:25
  • On Ubuntu 14.04, I also had to unplug and replug my device (Sony XPeria M). –  Apr 04 '15 at 18:55
88

I just had the same issue with the Motorola Droid. I had 3 devices and only 1 was detected in the ADB. The one that worked showed up in device manager as "android adb composite interface" and the 2 that did not work showed up as "android adb interface". In Windows 7 I did the following.

  1. Right Click Computer then Manage
  2. Expand Android phone at the top of the list
  3. Right click Android ADB Interface then Update Driver Software
  4. Browse my computer for driver software
  5. Let me pick from a list of device drivers on my computer
  6. Choose USB Composite Device then next

If USB Composite Device doesn't show up then try browsing to the usb_driver folder in your android sdk directory for step 5 then try step 5 and 6 again.

Note : If Android does not appear at the top of this list as described in #2 and/or you find a device ADB with no drivers then you probably need to install the device driver, which in my case (HTC Glacier) was located right on my phone.

TyrusC
  • 31
  • 4
Joe
  • 55,599
  • 8
  • 122
  • 132
  • 62
    YOU ARE FREAKING AWESOME! Do you know how many long nights I have spent contemplating cutting off my own thumb because of this issue? May all your children run as fast as Kenyans and you be blessed forever! – John Sonmez May 13 '11 at 03:21
  • 2
    @Sundhas first click "Device Manager" in the left pane. You can also launch this through the control panel. I'd also like to express how weird this problem is. I wonder if I had tried to copy files through USB first if it would have auto installed the USB Composite driver. – Tony Chan Jun 30 '11 at 22:57
  • 1
    I hope this solution works, but I'm using ADB in Linux/Ubuntu :-( – Hendy Irawan Aug 30 '11 at 12:39
  • I get a message saying there are no drivers available when selecting the folder %ANDROID_SDK%\extras\google\usb_driver or when selecting %ANDROID_SDK% for searching for drivers. – adam Jan 11 '12 at 05:07
  • Anyone know how to do this with WINDOWS XP? >. – Gabriel Fair Apr 13 '12 at 11:58
  • I had to install appropriate drivers (Samsung Galaxy usb drivers in my case) which i found on internet. – LittleSweetSeas Apr 26 '13 at 09:31
  • Awesome answer! Thank you so much! – octref Sep 19 '13 at 04:54
7

There is one thing some could not remember. Like myself, if you tried to run adb with superuser credentials following a run with regular user credentials, don't expect success. First, you have to kill adb which was run with lousy rights and start it again with sudo:

marek@deb42:~$ sudo adb kill-server

marek@deb42:~$ sudo adb devices

Marecky
  • 1,424
  • 1
  • 19
  • 35
  • Doing this makes my device appear properly on the adb devices list, however it still shows up as "?????????" in the Eclipse Android Device Chooser window. Is there a way to make Eclipse's ADT plugin run as root too? – 1337ingDisorder Mar 12 '15 at 01:15
3

Check that your device connected as PTP device(Camera). Notification Bar -> USB Connection. If your device connected as MTP(as common data storage) then AndroidStudio don't recognize it as debuggable device. At least that works for me and my Nexus.

3

I figured it out, though it sounds like we have different problems. However, just in case this helps you.

First of all your manifest has to have the android:debuggable="true" attribute in the Application node. You probably have this, and I don't know if it actually contributes to the device showing up or not.

In any event, the thing I was doing wrong was when I run or debug my configuration (in Eclipse) under the target tab (where it lists your emulator device setups) I had the Automatic radio button checked. If you flip that to manual it then gives you another dialog when you hit Run, and in THAT dialog, on the top, I see my device.

Lastly, (and I only see this on the Droid X) when you are in PC mode the device doesn't act as though it's connected to the machine. When you're in Mass Storage mode, everything works as expected BUT then the SD card is disabled, so, if your app happens to WRITE to the SD card it will fail at that point in execution. The Captivate (my other test device) does not suffer from the same problem.

Yevgeny Simkin
  • 26,055
  • 37
  • 127
  • 228
2

I had the same problem and after trying many of the solutions posted above finally tried changing the cable and it worked instantly.

someuser
  • 2,201
  • 4
  • 25
  • 38
2

On Window Machine Just Install adbdriver. It will autometicall get competible drivers for the connected Android Device.

I hope this will help everyone who is facing this issue.

Rupesh Yadav
  • 14,336
  • 5
  • 53
  • 68
1

Hope this solution will fix your mood this time!

Issue: My Android Device isn't recognized by the Eclipse ADT, why?

Cause: Device Driver was missing as it seemed at the end when I fixed it!

How to Fix:

  1. Search through web (using Google) "LG < Your_Phone_Model Number > Drivers Download".(Ex.:- Go to About phone in your settings list > Model Number, for me it's LG-E400f)
  2. Mostly the first few links are related to the required Device Driver download page.(Ex.:- for me I got the following link and for each device driver LG or most of the other vendors/manufactures have that kind of a Manuals and Drivers Page) Visit that page mentiioning about software update and drivers downloads.
  3. Scroll down to the section of "Manuals and Software Update" and doing just the Step 1 was enough for me, which is "Install the USB DRIVERS "
  4. Download it(for Mac or Windows) > Install It > Check Your Eclipse ADT > and it should be visible under Devices tab by now

Cheers!!!
Hope this helps to someone else to clearly get to the solution!

Randika Vishman
  • 7,157
  • 3
  • 55
  • 75
0

Another thing you can try is looking for the USB drivers from the manufacturers website. Windows Update does not always include these drivers. My Acer Iconia a700 tablet would not show up in Eclipse until I downloaded and installed the drivers from Acer's website.

jwatts1980
  • 6,991
  • 2
  • 24
  • 39
0

I have the same problem with xiaomi phone. Eclipse can detect all my other devices (including samsung and huawei).

Tried all the above and finally found the solution: just key in " ##717717## " and call and it will work!

Lee Yi Hong
  • 1,270
  • 13
  • 17
0

Unfortunately, the above solutions didn't work on my Samsung device Ace 2. But Installing Samsung Kies solve the problem

Thein
  • 3,534
  • 2
  • 26
  • 31
0

Install pdaNet(http://pdanet.co/a/) In between the installation if you get this message "Skip USB or something" in a pop up, close the pop up, unplug device then plug device, continue installation. Now eclipse should list your device :)

false9striker
  • 1,943
  • 3
  • 34
  • 38
0

Sometimes adb stops running on my mac, a simple:

adb kill-server
adb start-server

and restarting adb debug on the device will reconnect it.

noonan
  • 39
  • 3
0

I updated my Motorola drivers for my Droid 3 at some point, and then ADB could not find the device. After reading this question and top answer and still didn't work, I tried removing the driver first. Then unplugging the device, then replugging it in, Windows found and loaded the correct drivers. Joy! Hope this help someone else.

Yaakov
  • 229
  • 2
  • 6
0

A ridiculous thing worked for me, I ran the app then when the device window opened up I swapped which port the cord to the device was plugged into on my mac and bam found the device! Good luck this stuff can be tricky

ColossalChris
  • 5,078
  • 2
  • 34
  • 43
0

Ensure Debug mode is turned on, as well as allowing installations from unknown locations, if the problem continues, unplugging the device, rebooting and plugging the device back in should work. Another common problem is not having USB drivers installed, to solve this go on to SDK Manager and in Extras, download/update USB drivers

Eamon Scullion
  • 1,124
  • 6
  • 15
0

The device was not showing up because of the following line in android manifest file---

<uses-sdk android:minSdkVersion="18"
        android:targetSdkVersion="18"/>

I changed it to---

<uses-sdk android:minSdkVersion="8"
        android:targetSdkVersion="19"/>

Now it worked.

My God
  • 21,961
  • 23
  • 93
  • 166
0

After adding file to udev directory according to Yekmer Simsek, your /var/log/syslog will be showing this in log, when you RE-plug your device:

Jul  3 16:18:10 jupiter kernel: [16866.411654] usb 2-1.2: USB disconnect, device number 7
Jul  3 16:18:15 jupiter kernel: [16871.221603] usb 2-1.2: new high-speed USB device number 8 using ehci-pci
Jul  3 16:18:15 jupiter kernel: [16871.315693] usb 2-1.2: New USB device found, idVendor=18d1, idProduct=d002
Jul  3 16:18:15 jupiter kernel: [16871.315704] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jul  3 16:18:15 jupiter kernel: [16871.315710] usb 2-1.2: Product: Nexus 5
Jul  3 16:18:15 jupiter kernel: [16871.315715] usb 2-1.2: Manufacturer: LGE
Jul  3 16:18:15 jupiter kernel: [16871.315719] usb 2-1.2: SerialNumber: 0650f8e00ae573dc
Jul  3 16:18:15 jupiter mtp-probe: checking bus 2, device 8: "/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2"
Jul  3 16:18:15 jupiter mtp-probe: bus: 2, device: 8 was not an MTP device
Dimitry K
  • 1,874
  • 1
  • 21
  • 33
0

If you are using Eclipse, then see if Eclipse inadvertently converted your project to be a native java project. Do this by right clicking on your project name in eclipse and selecting the option "Convert to Android Project"

leandroid
  • 11
  • 2