51

I am developing Android application on macOS and my application runs well on the emulator. I want to run it on the device, but when I run adb devices I get nothing.

localhost:platform-tools BF$ adb devices 
List of devices attached 

localhost:platform-tools BF$

I have checked the documentation in the reference about "Setting up a Device for Development". I have done everything step by step.

In the documentation, there are some words: Setup your system to detect your device. If you're developing on Mac OS X, it just works. Skip this step.

Now, I can't find any solution. Does it need special drivers for Android Devices?

noob
  • 17,131
  • 18
  • 103
  • 168
  • 2
    Have you enabled USB debugging on the device? Can you mount the device as a usb mass storage device to test that the USB interface is functional? Can you try a different computer or android device? Does Mac OS have any system logs which will list the VID/PID of newly connected USB devices – Chris Stratton May 17 '11 at 06:27
  • 1
    Yes. I have enabled the USB debugging on the device. OK.I will try some solution later. thanks your warmly help~~~ I can see the storage card in the device. but use the "adb devices" can't list the device. – Xubing in China. Developer May 17 '11 at 07:26

16 Answers16

59

I know this thread is old, but I think this could still help. Almost all the time "it just works" on OS X, but sometimes new/prototype or obscure devices aren't picked up. Try to help it out with these steps (I'm not near my Mac right now, but I did this last night and think I remember):

  1. Open System Profiler and find the device on USB. View it's details to find the Vendor ID. For example, Motorola devices will show 0x2bb8. Or just Google for your vendor's hardware id.

    If nothing shown, make sure to try different cables. Android File Transfer is good for detecting the device if you have a valid cable.

  2. Edit ~/.android/adb_usb.ini to include that Vendor ID. If the file doesn't exist, create it with that line only.

  3. Restart ADB

    adb kill-server 
    adb start-server
    
  4. Maybe unplug/plugin your phone.

And hopefully you see your device.

Pablo Bianchi
  • 1,039
  • 1
  • 15
  • 23
jarvisteve
  • 916
  • 8
  • 14
  • 1
    I originally did this for the Kindle Fire. I just updated a bunch of android files through the eclipse manager and it "reset" my old adb_usb.ini. Once I added the KF id of 0x1949 to the adb_usb.ini again I unplugged/plugged my device back into USB and viola. – Jacksonkr May 03 '12 at 21:07
  • 5
    YES YES YES! Thank you so much, jarvisteve. You are a hero. Editing ~/.android/adb_usb.ini is the way to go! – Bram Oct 16 '12 at 20:48
  • 1
    it's not working in sdk v22. if I added texts in adb_usb.inifile. after I `adb kill-server`, I cannot start server via `adb start-server`. It will complain `* daemon not running. starting it now on port 5037 *. ADB server didn't ACK * failed to start daemon * error: cannot connect to daemon`. It would only recover if I cleared the added texts! – Xiao Jun 13 '13 at 03:20
  • 2
    @Sean You may have edited the file incorrectly. I had the same issue at first, because I left one empty line between the generated comments and the vendor ID. The issue was then solved by removing every empty lines in the file. HTH – Justin Lau Aug 23 '13 at 11:22
  • Forcing the vendor ID into adb_usb.ini worked for me. Finally ... I really wanted to kill that server. – MikeMurko Apr 20 '15 at 21:08
  • 1
    @JustinLau: The same happened to me when I had a blank line *after* the vendor ID. As you say, removing every empty line solved that problem (the server starts successfully now). However, adb still can't see my device. :-( – LarsH Jun 06 '15 at 00:11
32

Are you by any chance also using the app EasyTether while connected to your Mac? If you happen to use this app, you're in luck, because the solution is to call:

sudo kextunload -v /System/Library/Extensions/EasyTetherUSBEthernet.kext

from a terminal. I forget if you have to reboot or not.

This will disable tethering, but you can now see your device via adb.

To renable tethering once you're done debugging, use

sudo kextload -v /System/Library/Extensions/EasyTetherUSBEthernet.kext

Of course, if you're not using EasyTether, then hopefully someone else has an idea....

levis501
  • 3,753
  • 20
  • 22
  • 2
    No,there doesn't exist such software on my Mac. – Xubing in China. Developer May 17 '11 at 07:37
  • haha, funny i just unloaded that kext and for some reason im still having issues. was hopeful the kextunload would solve my problem... no dice – LuxuryMode May 22 '11 at 02:51
  • 3
    I was totally baffled why I couldn't see my Android devices anymore and you totally saved my day! I would have had no idea this was the issue, thanks a million! – justinkmunger Jun 07 '11 at 00:02
  • 1
    Thank you! How did you figure out that the EasyTether kext was causing the issue? I would love to learn how you did that. – Eddified Aug 24 '11 at 04:36
  • 3
    FAQ for EasyTether http://www.mobile-stream.com/easytether/android_faq.html#adbmacosx . – levis501 Aug 24 '11 at 05:44
  • 1
    I actually notice that once the device is discovered, I can re-enable tethering and it stays registered w/ the adb. – Paul Mar 24 '12 at 23:52
  • You are a LIFESAVER! This was my problem! – user357614 Dec 11 '12 at 00:46
  • Wow, very specific answer that (almost) fixed my problem. I also changed cables shortly after using EasyTether and the cable was for charging only (see Shaun Mcdonald's answer). That was fun to try to solve. I was also using EasyTether in VirtualBox, so I also removed the USB filter from VirtualBox. That was between the two steps mentioned above so I am not sure if it was an issue. – Ryan Mar 26 '13 at 20:45
  • fyi: you don't need to reboot anything, just disconnect the usb cable and reconnect – Edward Falk Jul 23 '13 at 19:06
  • Yes it's an my headache problem.after installing easy tether to mac connected android device not shown in eclipse IDE.When i am executing sudo kextunload /System/Library/Extensions/EasyTetherUSBEthernet.kext this command too.But nothing helps me to figure out the connected device problem...I also removed EasyTether network connection from System Preferences. – Android_kalai Jul 03 '14 at 11:36
  • After trying everything else and not thinking that I had dormant EasyTether files this worked for me. If you've tried all the other obvious options give this a shot. – Yoshi Apr 22 '16 at 16:49
  • I had a dormant EasyTether kext installed and removing it resolved this problem for me. I did have to reboot afterwards before it worked. – Chris Miller May 06 '16 at 14:35
25

Same problem here. osx 10.6.6 and adb devices giving $ ./adb devices List of devices attached ...empty....

Rebooting the phone didn;'t help although it was listed with adb devices just for a second during the booting process.

Debugging was turned on in adroidsettings->applications

What finally made it tick: turning debugging mode off and on again.

miele
  • 311
  • 3
  • 2
16

If you're struggling with such an issue using Lollipop (Android 5.*) probably you guys should do one simple step that I'd done before my ADB (I use Ubuntu) got my phone:

Change USB PC connection type to "Send images(PTP)" (before I've been using "Media device(MTP)")

Just like this:

Screenshot

And don't forget to activate checkbox "USB debugging".

Andrew
  • 31,284
  • 10
  • 129
  • 99
15

I had this problem today where the phone was charging when connected, but wasn't seen by the Mac. It turned out the micro USB cable that I was using was for charging only and didn't do data. Once I changed the USB cable it started working fine.

Shaun McDonald
  • 6,016
  • 2
  • 23
  • 22
  • Hard to believe but this is so true! I mistakenly used another cable looks same today, it can charge but data won't work. I reliazed that by reading your answer, replaced and it works! Thanks! – Billy Chan Jun 30 '15 at 08:45
  • This has been the case for me several times. You'd think the newer cables would work find, but it usually turns out to the be the older, "plain" ones that work. – daleyjem Nov 22 '16 at 02:30
  • Also very surprised by this one, but sure enough was the problem – jordancooperman Dec 20 '16 at 17:02
13

Referenced from this link!

THIS IS FOR A MAC ONLY!

Here’s what you need to do to make your phone visible to adb:

  1. Open terminal (Applications/Utilities/Terminal)
  2. cd /System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/IOUSBCompositeDriver.kext/Contents
  3. sudo nano Info.plist (or vi, or emacs, or whatever console editor you prefer)
  4. Copy the IOUSBComposite section (from <key> to </dict>)
  5. Paste the section in at line 66 (right after where it appears) so you have 2 copies in the file
  6. Change the bDeviceSubClass value from 0 to 2
  7. Change the key name from IOUSBComposite to GW620

The end result should look something like this:

                    <key>GW620</key>
                    <dict>
                            <key>CFBundleIdentifier</key>
                            <string>com.apple.driver.AppleUSBComposite</string>
                            <key>IOClass</key>
                            <string>IOUSBCompositeDriver</string>
                            <key>IOProviderClass</key>
                            <string>IOUSBDevice</string>
                            <key>bDeviceClass</key>
                            <integer>0</integer>
                            <key>bDeviceSubClass</key>
                            <integer>2</integer>
                    </dict>

  1. sudo diskutil repairpermissions / and let it finish
  2. sudo touch /System/Library/Extensions and wait a few mins for the extension reindexing to finish
  3. adb devices should now see your phone

Note, this is VERY kludgy, and will probably break every time OSX updates itself, but it works. I can finally stop rebooting every time I want to work on the phone! :D

LarsH
  • 25,732
  • 8
  • 77
  • 136
Raymond
  • 131
  • 1
  • 2
  • this worked for me!, nexus 4(also an lg model). Needed to reboot osx before it took effect. Also, beware if you screw up editing Info.plist you could risk losing connection to your usb keyboard/mouse! (luckily I had a bluetooth keyboard nearby) - worked on OSX v10.6.8 – Peter P. Oct 13 '13 at 16:57
  • Worked for me in mavericks, did not need to reboot. – deweydb Dec 02 '13 at 16:57
  • On El Capitan (10.11.3) `sudo diskutil repairpermissions /` just gives the error message `diskutil: did not recognize verb "repairpermissions"; type "diskutil" for a list`. Any idea on how to get around it? – Roy Solberg May 04 '16 at 18:48
  • this worked for me, although strangely enough all I needed to do was just *open* the contents of the directory in step 2)... nothing more, and all of a sudden my macbook started recognizing my device. I had tried every other remedy and this problem was killing me. Thanks! – hunter Jan 01 '17 at 17:33
12

If adb devices does not list the device though you have plugged it in to the system, you need to ensure that USB debugging option is checked in the Developer Options tab under Settings. Under Android 4.2.2 and above (from what I have observed), the Developer Options are hidden unless explicitly revealed. To make Developer Options active, tap 7 times on the Settings > About device > Build number. Once done, go back to Settings > Developer Options and activate USB Debugging.

Using adb version 1.0.31, I was able to make the device visible.

Sriram
  • 9,536
  • 20
  • 74
  • 130
  • This was all that was required to get my cheap Alcatel OneTouch to appear. I can now use it to test using cordova. – blythburgh Dec 15 '15 at 15:41
8

I was having this problem. It turns out my fix was to change the USB cable I was connecting with. I switched back to using the cable that came with the phone and it worked.

Using Samsung Galaxy Player and Samsung micro USB.

Yes. This is incredibly dumb.

atreat
  • 3,713
  • 1
  • 26
  • 33
  • I wonder if this is my problem. I'm having trouble with a Samsung Galaxy Tab 4, 7". Don't know if it came with a cable though. – LarsH Jun 06 '15 at 00:15
6

If using adb devices on Mac OS X no device is displayed and, of course, you have enabled the USB debugging on your device (see http://developer.android.com/tools/device.html), then try with:

$ android update adb
adb has been updated. You must restart adb with the following commands
    adb kill-server
    adb start-server

Then:

$ adb kill-server
$ adb start-server
* daemon not running. starting it now on port ... *
* daemon started successfully *

And finally:

$ adb devices
List of devices attached 
......  device

Your device should be now in the list.

Paolo Rovelli
  • 8,082
  • 1
  • 52
  • 37
  • Indeed the USB debugging option in my phone did the trick for me. I had enabled it before, so I thought it was still enabled, therefore it took me a long time to realize to actually double check the option. Turns out that it turns itself off automatically. – physicalattraction Jun 03 '15 at 06:42
  • Turning on USB debugging did it for me. (I didn't even have to kill the adb server.) This is strange, because elsewhere I read that I should turn *off* USB debugging. – LarsH Jun 06 '15 at 00:18
2

On Mac Lion :

I just had to go to /path/to/android-sdk/tools and run android adb update for the devices to be detected.

500865
  • 6,500
  • 5
  • 40
  • 83
1

make sure you have same / higher API level installed on SDK packages with your devices.

example :

I have Android 2.3.4 on my Xperia Play. ADB wouldn't detect my device if theres only API 10 (Android 2.3.3) installed on my Mac. When i installed SDK 11 (Android 3.0) -- since I didn't found any SDK package for 2.3.4, the ADB working fine.

hope this help you.

blackbiron
  • 402
  • 6
  • 16
0

restart the adb server works for me, in emulator, vmwware and virtual

adb kill-server
adb start-server

if you´re using a virtual machine, make sure you have an IP assigned with:

Alt + 1
type: netcfg

to go back:

Alt + 7

if you have:

 eth0: DOWN 0.0.0.0/XX

change your configuration to:

NAT or BRIDGE

Restart the virtual machine and server, and tried again.

if you´re using a phone or tablet:

  • unplug your device

  • wait a moment and plug it again

  • and restart the adb server

Hope this help you

Defrag
  • 146
  • 1
  • 5
0

The same problem I had on Windows 7. It happened that I was using USB tethering feature alongwith trying to use adb. There are some workarounds for this Usb tether and debug at the same time

Community
  • 1
  • 1
PCoder
  • 2,095
  • 2
  • 21
  • 32
0

Just because your Android device is in Developer Mode, doesn't mean it has USB debugging enabled!! Go into Settings > Developer options then enable "USB debugging" and then you should see your device. It's a common mistake that's easily overlooked.

Eptin
  • 1,844
  • 4
  • 21
  • 40
0

You will need USB driver installed correctly and have debugging enabled in settings. if these dont work there could be something wrong with your device.

Also see this.

Fahim Parkar
  • 28,922
  • 40
  • 153
  • 260
Tony Le
  • 21
  • 1
-1

I had Xamarin installed and tried to use Unity. Basically in any case you have to kill any application that might be talking to your device through ADB

user1767754
  • 18,800
  • 14
  • 111
  • 133