adb not finding my device / phone (MacOS X)

2019-01-01 08:05发布

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

标签: android adb
29条回答
路过你的时光
2楼-- · 2019-01-01 08:29

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.

查看更多
旧人旧事旧时光
3楼-- · 2019-01-01 08:30

Additonal Update : Do not underestimate the value of a good USB cable. Sometimes just swapping cables will help.

Update for newer 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
查看更多
听够珍惜
4楼-- · 2019-01-01 08:30

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.

查看更多
人间绝色
5楼-- · 2019-01-01 08:30

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

查看更多
余欢
6楼-- · 2019-01-01 08:32

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.

查看更多
梦醉为红颜
7楼-- · 2019-01-01 08:33

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

查看更多
登录 后发表回答