Can't find android device using “adb devices” command

后端 未结 16 1039
梦如初夏
梦如初夏 2021-01-30 00:49

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 dev

相关标签:
16条回答
  • 2021-01-30 01:29

    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.

    0 讨论(0)
  • 2021-01-30 01:32

    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.

    0 讨论(0)
  • 2021-01-30 01:37

    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

    0 讨论(0)
  • 2021-01-30 01:37

    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.

    0 讨论(0)
  • 2021-01-30 01:38

    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.

    0 讨论(0)
  • 2021-01-30 01:39

    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.

    0 讨论(0)
提交回复
热议问题