dustmachine
dustmachine

Reputation: 10814

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

Upvotes: 220

Views: 344302

Answers (30)

Fotios Tsakiris
Fotios Tsakiris

Reputation: 1556

In my case (Samsung s5e tablet) after enabling developer mode by taping the build number 7 times, I also had to switch on the USB debugging under Developer Options

Upvotes: 1

Mr. Kabir
Mr. Kabir

Reputation: 793

I faced the same problem and spent half of the day searching for a solution. But everything was in vain. In the first answer, there it is mentioned about USB cable issue which didn't catch the attention. So if someone goes through the same issue, I'll suggest, first of all

Try some other USB Cables because some cables are used only for charging rather than transmitting data

If it doesn't bring you luck then you can try out other answers.

Upvotes: 5

Cyber
Cyber

Reputation: 2704

Just for all iPhone users.. you cannot use a physical iPhone, you need to run an Android Simulator.

Just in case you try to use Android Studio with an iPhone.

Upvotes: -5

Sergey Lukin
Sergey Lukin

Reputation: 489

Got it working by restarting my Oneplus 5T after enabling Developer mode.

Upvotes: 0

dustmachine
dustmachine

Reputation: 10814

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:

System Information, Hardware USB tree

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

Upvotes: 419

Youssof
Youssof

Reputation: 1001

When I plugged the Android 10 device to the Mac OS a popup showed on the phone saying:

The Mac OS cannot access data on this device, you will have to download filetransfer or smart-switch.

  1. Download file transfer https://www.android.com/filetransfer/ for android
  2. Download smart-switch https://www.samsung.com/us/smart-switch/ for Samsung I guess

Though not sure why there are two options here!

I downloaded file transfer and it worked perfectly even though the device was Samsung Note.

Note: I forgot to mention that first you have to enable Developer mode then USB Debugging.

Upvotes: 0

rayen
rayen

Reputation: 370

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:

  1. Connect Android device via USB cable(double USB-C cable worked for me).

  2. Go to Settings -> .. -> Developer Options and click Revoke USB debugging authorizations

  3. The Android phone will go for a reboot.

  4. Go to Settings -> .. -> Developer Options and make sure USB debugging is enabled.

  5. Now in macOS terminal enter:

    adb devices
    
  6. You can see your device listed.

It worked for my Google Pixel 2 phone.

Upvotes: 3

Lajos Mészáros
Lajos Mészáros

Reputation: 3871

Just an extra bit of help: the device needs to be directly connected to the computer, connecting it to an USB hub might prevent the device prompt from displaying.

Upvotes: 0

zzantares
zzantares

Reputation: 350

For me this is what worked, I have a Huawei device and I had to install HiSuite from the AppStore, followed its instructions to enable HDB, then in my phone change USB mode to PTP and I started to see some popups about authorizing the device, after that adb devices detected the device.

Upvotes: 0

Venkat Kotra
Venkat Kotra

Reputation: 10753

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

Upvotes: 6

Saru
Saru

Reputation: 861

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

Upvotes: 7

Rock_Artist
Rock_Artist

Reputation: 735

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.

Upvotes: 3

King Tat Lam
King Tat Lam

Reputation: 383

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

Upvotes: 35

Michael Osofsky
Michael Osofsky

Reputation: 13135

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.

Upvotes: 3

Nelson G.
Nelson G.

Reputation: 5441

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.

Upvotes: 15

natario
natario

Reputation: 25194

I was trying to connect an old phone that I use to test apps on older API versions. Today adb was not finding it.

After trying pretty much everything here, I figured out that the phone was not even showing the system notification about the USB connection going on.

So I looked around for that issue, and found the solution here (credits to the original source):

  1. Remove phone from PC and remove battery to shut off phone.
  2. Plug USB cable into PC.
  3. Plug USB cable (other end) into phone.
  4. The PC install new hardware appropriate drivers for a few minutes (phone without battery)
  5. Unplug USB cable from phone
  6. Put battery back in and turn on phone
  7. As the phone boots, hold down Volume up and down. Phone boots into safe mode.
  8. Plug USB cable into phone.
  9. I saw notification about USB MTP-connecting on the phone. PC have found my phone!
  10. After the reboot in normal mode problem was fixed

Not sure step 4. is of any use here on macOS, however I did all the steps and it worked well.

Upvotes: 0

user501138
user501138

Reputation: 899

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.

Upvotes: 1

ayl
ayl

Reputation: 394

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.

Upvotes: 2

user1959383
user1959383

Reputation: 61

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

Upvotes: 5

Scott Dreier
Scott Dreier

Reputation: 11

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.

Upvotes: 1

K.K
K.K

Reputation: 2657

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:

  1. Get the SDK (Latest Version) from developer.android.com
  2. Put developer mode on nexus 4 ( About Phone > Build Number > tap 7 times to enter Dev Mode)
  3. A new menu option will come up in the 'Settings' : { } Developer Options
  4. 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

Upvotes: 64

guyromb
guyromb

Reputation: 811

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).

enter image description here

Upvotes: 37

Fintan Kearney
Fintan Kearney

Reputation: 764

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.

Upvotes: 6

Mukul Aggarwal
Mukul Aggarwal

Reputation: 1585

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......

Upvotes: 0

Ujjwal Singh
Ujjwal Singh

Reputation: 4988

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

Upvotes: 2

Janac Meena
Janac Meena

Reputation: 3557

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.

Upvotes: 1

intellectual_stretch
intellectual_stretch

Reputation: 121

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".

Upvotes: 3

Shai UI
Shai UI

Reputation: 51918

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.

Upvotes: 11

Akshay Agarwal
Akshay Agarwal

Reputation: 2039

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.

Upvotes: 1

Michael
Michael

Reputation: 9402

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.

Upvotes: 8

Related Questions