Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't find android device using "adb devices" command

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?

like image 863
Xubing in China. Developer Avatar asked May 17 '11 06:05

Xubing in China. Developer


People also ask

Why my device is not showing in adb devices?

On Android 5.0, go to Settings -> Storage -> menu -> USB computer connection and make sure 'Media device (MTP)' is disabled. When it's disabled 'adb devices' lists the device, when enabled not.

How do I fix the adb command not found?

If the ADB command is not found, most likely you need to install the Android SDK Platform-Tools package to make it available in the command prompt. Also, the phone should be in USB debugging mode.

Why is adb not working?

Failed ADB connections usually have one root cause: bad Android USB drivers that load in place of the right ones. Windows doesn't make it easy to remove the wrong drivers, unfortunately. But before attempting to troubleshoot an ADB connection, first enable USB debugging on your phone if it's not on already.


1 Answers

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.

like image 78
jarvisteve Avatar answered Oct 05 '22 22:10

jarvisteve