ChatGPT解决这个技术问题 Extra ChatGPT

adb not finding my device / phone (MacOS X)

Doing Android development on a Mac and this very new phone I have doesn't show up in the devices list in adb. Lots of other phones and devices work fine for me so I know my setup is good.

I have debugging enabled (Settings --> Applications --> Development --> USB debugging) on the phone, but it just doesn't show up when I run adb devices

for anyone struggling with a Samsung phone, I found I had to install Kies for the device to be recognised
You should use the PTP when usb debugging instead of multimedia (MTP) --
Settings->Developer Options->USB Debugging on.
The Q is for a "very new phone", and I wanted to add that actually in my case, the phone really was too old. Totally working and fine, and not that ancient, but too old for my mac apparently.

d
dustmachine

Important Update : As @equiman points out, there are some USB cables that are for charging only and do not transmit data. Sometimes just swapping cables will help.

Update for some versions of adb, ~/.android/adb_usb.ini has to be removed.

Executive summary: Add the Vendor ID to ~/.android/adb_usb.ini and restart adb

Full Details: Most of the time nothing will need to be done to get the Mac to recognize the phone/device. Seriously, 99% of the time "it just works."

That being said, the quickest way to reset adb is to restart it with the following commands in sequence:

  adb kill-server
  adb devices

But every now and then the adb devices command just fails to find your device. Maybe if you're working with some experimental or prototype or out-of-the-ordinary device, maybe it's just unknown and won't show up.

You can help adb to find your device by telling it about your device's "Vendor ID," essentially providing it with a hint. This can be done by putting the hex Vendor ID in the file ~/.android/adb_usb.ini

But first you have to find the Vendor ID value. Fortunately on Mac this is pretty easy. Launch the System Information application. It is located in the /Applications/Utilities/ folder, or you can get to it via the Apple Menu in the top left corner of the screen, select "About this Mac", then click the "More Info..." button. Screen grab here:

https://i.stack.imgur.com/dKFco.png

Expand the "Hardware" tree, select "USB", then look for your target device. In the above example, my device is named "SomeDevice" (I did that in photoshop to hide the real device manufacturer). Another example would be a Samsung tablet which shows up as "SAMSUNG_Android" (btw, I didn't have to do anything special to make the Samsung tablet work.) Anyway, click your device and the full details will display in the pane below. This is where it lists the Vendor ID. In my example from the screenshot the value is 0x9d17 -- use this value in the next command

echo 0x9d17 >> ~/.android/adb_usb.ini

It's okay if you didn't already have that adb_usb.ini file before this, most of the time it's just not needed for finding your device so it's not unusual for that file to not be present. The above command will create it or append to the bottom of it if it already exists. Now run the commands listed way above to restart adb and you should be good to go.

adb kill-server ; adb devices

* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached 
123ABC456DEF001 device

For me it was the cable - much appreciated
it was the cable, I can't believe it, al the cables that come with indipad tables do not work!
Yeah for me it was the cable too! I was searching things about drivers and config files, but it was just the cable! Thank you for your aditionnal update
Cable issue here as well. Thanks!
Don't underestimate that cable! Tried everything and it was the cable!
C
Community

Solution specific to Nexus 4 and Nexus 5 for OS X

Got no device listed in the "List of devices attached" when I ran: adb devices

Fix:

Get the SDK (Latest Version) from developer.android.com Put developer mode on nexus 4 ( About Phone > Build Number > tap 7 times to enter Dev Mode) A new menu option will come up in the 'Settings' : { } Developer Options Make sure you check the following under { } Developer options: USB Debugging : Debug mode when USB is connected (Accept the RSA fingerprint popup) Verify apps over USB : Check apps installed via ADB/ADT for Harmful behavior

Try listing your device from ./adb devices and it should work.

Answer taken from: Any idea why adb does not recognize my nexus 4 on mac


Thank you so MUUCH! That was it for me ;)
d
deepwinter

If you have installed the application EasyTether, this can interfere with ADB.

From this page you can execute the command:

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

this will unload your EasyTether extension.

If you need to re-enable EasyTether for tethering, I believe you can use:

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

This worked on my Samsung Galaxy S2. It's been necessary in my case to execute the kextunload command everytime I reboot.


damn thanks for this ! forgot I installed this crap 3 weeks ago !
thank you so much... this is exactly what my problem was
Yes it's a 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.
Never installed this EasyTether thingy, but there it was, after I disabled it it worked for adb devices. now I have to make fastboot devices work...
I used EasyTether -ages- ago and forgot I had left it installed. This did the trick for me.
B
Bhargav Rao

If you are using following devices: Samsung S3 GT-I9305 (Android 4.1.2) Mac OS 10.6.8

Do following:

# echo "0x04e8" >> ~/.android/adb_usb.ini
# adb kill-server
# adb devices

(if you are not using Samsung device, change the Vendor ID "0x04e8" to the correct value of your Vendor)

If still not working, you may want to try following:

(1) On your Samsung device, disable "USB Debugging" and re-enable it again (and try the adb commands again)

(2) Disconnect the USB cable, and re-connect it again

(3) Uninstall Samsung Kies

(4) Install Android File Transfer

(5) Reboot your Mac and the Samsung device

(6) Use hardware device to test your Android app

After getting the devices connected but you suddenly unplug the USB cable, and suppose now "adb devices" cannot see your device any more, even after "adb kill-server", in this case, you may want to try the following:

(1) power off your Mac (2) disable "USB debuggine" on your Samsung device (3) power off your Samsung device (4) power on your Mac (5) power on your Samsung device (6) enable "USB debuggine" on your Samsung device (7) connect the USB cable (8) Run "adb devices" (9) You should see the attached device now


I was going to upvote this answer specifically for the link to vendors, but the link tries to instal ad-ware. I didn't try the other links, but I'm sure they do the same things.
Worked for me for a Mediacom S2 tablet. The Console.app shows the vendor ID when connecting the device: 13/02/14 11:17:27,000 kernel[0]: USBMSC Identifier (non-unique): 0123456789ABCDEF 0x2207 0x10 0x222, 2 The VendorID is, in this case, 0x2207
Downvoting because the link to Android File Transfer is adware. Use this link instead: android.com/filetransfer
The latest 10 steps procedure what was I was searching for. Thank you!
nothing worked for me. Still can't find my gs7 on recovery mode
C
Case

Believe it or not, swapping USB cables solved this for me. I'd been using a random one (which wasn't working), and as soon as I switched over to one that came with an actual Android device, it worked.

Another sign that the good cable was working, was that the Android File Transfer app immediately launched, which wasn't happening with the crappy cable.


Plugging USB cable to different USB port might also solve "adb devices" problem if computer occasionally stops detecting your device.
This just worked for me too. Can't believe the amount of time I've wasted on this...
Happened to me too and I have no idea how it works. USB cable is a USB cable - Charging is working just fine, why wouldn't ADB work? That's some monster-gold-plated-cable magic stuff :(
To everyone who had connected with a not-working cable once: Did you get the dialogue on your phone that says like "Allow file access" and did your phone go to debugging mode? Or did it just say "charging over USB"?
g
guyromb

I had a similar issue. I've discovered that MTP is not supported in OSX. I changed it to PTP, I was promoted to approve my laptop and then my device was finally listed (LG G3).

https://i.stack.imgur.com/cO4Ze.png


LG G2, had to select PTP. Thanks!
The Alcatel OneTouch Idol 3 had defaulted to Charging mode yet mislead me with the continuous USB debugging connected notification. I had to scroll past the misleading, enabled USB Debugging switch and open the Select USB configuration menu.
This worked for me - note that to get to this menu you may need to enable USB Debugging, then from the notifications bar up top tap on the USB connection dialog and switch from MTP to PTP. After you should see a dialog to accept connection to your computer.
Same thing! Had to switch to Transfer photos (PTP) on Nexus 5X.
For me I needed to change "Use USB for" from ( ) Transferring files to (*) USB tethering. I accessed this option from the "notification" pull down on the main screen of the phone.
b
brew

Also make sure you are not using an USB cable designated for charging only. This just got me. And it actually was labelled "for charging only"


I was totally not expecting this solution, but yeah changed my usb cable and there was my device.. :/ :/
With a normal USB, two contacts are used for data, and two are used for power. Those "for charging only" cables probably cut manufacturing costs by omitting the data connections.
Thanks, I was having the same issue. I was using the USB to microUSB cable from a portable charger thinking it would be a standard cable, but I guess it was actually for charging only. Swapped it out for a normal USB to microUSB cable and it worked.
b
bartonstanley

In my case, it was because the USB cable.

I discovered there are two types of USB cables:

Those that only supply power

Those that supply power and can transfer data

And it's hard to know what type is a USB cable. Now I make a notch on my cables with data transfer.


90% of the time, for me, this is the problem. Thanks for the feedback.
S
Shai UI

This only worked for me after I've enabled developer usb debugging on the phone:

On your android phone, go to Settings > About, then tap repeatedly on Build Number until Developer Options is enabled.


This and clicking on Settings->Developer Options->USB Debugging seem to have done the trick.. I am using an AstroTab w/5.0. Thanks!
This was THE thing for me. Now also adb devices showed my Samsung Galaxy A5 2015.
B
Bruno Bronosky

NOTE TO FOLKS WHO CANT GET ANY OF THIS ADVICE TO WORK

Try launching Console.app and watching for errors when you plug in your device. I was getting

# The IOUSBFamily is having trouble enumerating a USB device that has been plugged in. It will keep retrying.

It persisted after reboots, so I eventually reset my PRAM and that got it working again.

HOW TO PERFORM A PRAM RESET

Shut your machine down completely. Briefly hit the power button Hold down Command + Option + P + R Wait until you hear the boot chime for a 3rd time Release all keys and let the machine continue to boot completely


I have the same problem "IOUSBFamily is having trouble enumerating a USB device". I have tried every possible solution, even PRAM RESET. Did not work for me :( Any other suggestion? Everything was working fine before and now suddenly none of my 3 devices are being recognized. charging is being done for the samsung ones, for nexus 4 not even that.
THANK YOU ! I tried the first 6 answers and nothing worked. In the end, your solution worked great. Your solution should be added in the most upvoted answer.
@MaximeBernard - did you get the Console.app error as well or did you just reset the PRAM?
M
Michael

Here is another thing to try, if like me you have tried all of the other answers and have had no luck.

In my case (Android 4.3) I went into the USB settings under the notifications and changed from MTP mode (Media device) to PTP (camera) and as soon as it switched, the device showed up in the ADT device list.


Lifesaver! Thank you, worked right away for my LG L90 (D415)!
S
Saru

Simply changing the cable and Authorizing the Mac worked for me!


A few times this has happened to me and it was the cable - perhaps just for charging and not rated for data transfer
Same for me; check the cable.
i
itzmebibin

With the newer adb version, you have to remove ~/.android/adb_usb.ini


rm .android/adb_usb.ini; adb kill-server; adb devices
F
Fintan Kearney

I was experiencing the same issue and the following fixed it.

Make sure your phone has USB Debugging enabled.

Install Android File Transfer

You will receive two notifications on your phone to allow the connected computer to have access and another to allow access to the media on your device. Enable both.

Your phone will now be recognized if you type 'adb devices' in the terminal.


Opening Android File Transfer did the work for me, thanks!
V
Venkat Kotra

I had to enable USB debugging (Security settings) developer option in addition to USB debugging in Redmi Note 4.


Even I had to enable USB debugging for Redmi Note 7 to make it work.
A
Adam Johns

if you are trying to detect a samsung galaxy s3, then on the phone go to settings -> developer options -> make sure usb debugging is checked


I'm android dev working daily with, among others, Galaxy Nexus. Somehow USB debugging got deselected on its own, no update no change from half an hour ago what so ever. I've enabled it again and its working. This gave me clue to check it, thanks.
i
intellectual_stretch

Just in case it helps somebody in the future, I had accidentally turned off "USB debugging" in my settings when I was enabling/disabling "Show layout boundaries". So, first check this setting in your "Developer options".


I needed to toggle this off and then on again to repair with my mac.
C
Community

I switched to a different USB port and that got it to show up in the adb devices list.

That was the only thing that worked for me of all the solutions proposed here. It was proposed by @user908643 in this comment.


R
Rock_Artist

Another tricky thing with modern Android is you set the device behavior by selecting "Use for" of the device.

If it is set as "Use for" charging for example the device won't be detected by ADB. switching to PTP/MTP other behavior which is more 'active' will auto-magically make your device detectable.


if I go to USB preferences in settings to set to PTP they are all greyed out :|
g
gmile

None of the above answers worked for me. On macOS Mojave, open console app, you may see an error like this:

001076.240057 adb@(null): IOUSBUserClientLegacy::start: missing entitlement com.apple.appledfr.client

Even resetting the mac PFRAM didn't help. To fix this issue:

Connect Android device via USB cable(double USB-C cable worked for me). Go to Settings -> .. -> Developer Options and click Revoke USB debugging authorizations The Android phone will go for a reboot. Go to Settings -> .. -> Developer Options and make sure USB debugging is enabled. Now in macOS terminal enter: adb devices You can see your device listed.

It worked for my Google Pixel 2 phone.


close to be same for me, but this way you described helps time to time, sometime helps changing usb socket, but eventially it goes into stuck and does not sees my device constantly untill mac reboot. Have you figured out what is really going on?
This setting saved me, thanks. Apparently a recently Android update left my Developer settings turned ON, but turned OFF my USB debugging switch. Turning it back on resolved it.
c
code4cause

Also make sure you check the vendors website for their "USB" drivers. I had this problem with my AT&T Galaxy Note (Running Android 2.3.6) and it wasn't being recognized by the adb without a driver install that I got from the samsung website.


U
Ujjwal Singh

Try rebooting (if it was ever detected before and stopped showing up) - the mother of all solutions!


i
itzmebibin

None of the tips above worked for me on my Mac OS X Lion set up. I have Motorola phones running 2.3.6. It turns out that I needed to install drivers for Motorola phones. I found them here.


A
Akshay Agarwal

Its damn strange but just plugging to the USB port located next to Thunderbolt port on my mid-2014 MBP with Retina worked!

The other USB port would simply not recognise the device.


C
Community

On the LG G3 I was able to get it working by installing ADB via homebrew (Installing ADB on MAC OS X) and then disabling/enabling USB debugging.


i
itzmebibin

Tried all the above, the last piece missing was to enable USB Debugging within Developer Options which was hidden on my 4.4 Galaxy Note 10.1.

See item 5.2 from this link.


Could you summarise the link, in case it breaks?
j
jrea

I had a devil of a time with this.

I attempted this method but it did not work. I ended up turning OFF USB debugging and the device then requested that install motocast.

It attempted to use the build in installer but it kept crashing past the download. After I downloaded it manually and installed it, I was able to do it.

I am running 10.6.8 and the device is a Xoom 2 running 3.2.2

After that installation, it worked fine.


p
poff

In case, like me, none of the above worked for you, I figured out a very stupid solution.

I'm using a HTC One X on a 2011 Macbook Pro. I just disabled NFC in Settings > Wireless & Networks > More > NFC and viola! Working normally.


M
Mukul Aggarwal

I have seen this problem and tried every solution on stackoverflow and other sites, but nothing help me. I have restarted adb, switching on developer mode and activating usb debugging, uninstalling samsung kies and even exchanging the usb cables to different ports. But then I read somewhere that different usb cable use different pins for connecting to the laptop or computer. So I used different usb cable to connect my samsung phone to mac .. and vowwww it works... for me......


In my case it was the cable. I changed it with a quality cable and all devices were found.
u
user501138

In my case, USB debugging wasn't enabled on my device yet connecting the device to my macbook didn't cause the familiar "Allow USB Debugging" dialog to pop up on the screen.


For anyone with this problem (like I've been for the past several hours), all you need to do is follow the instructions from the site below eltima.com/wiki/user-guides/syncmate/usb-debugging-android.html Instructions go as far as v4.0 of Android. I've scoured the internet, searching "Android can't connect to Mac" and the like with all solutions asking to enable usb debugging mode, but with none stating how to access this option. After 3 applications and 5 installations later I find this website because of an app called SyncMate. I'm going to relax and enjoy Christmas now.