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

后端 未结 16 1387
梦如初夏
梦如初夏 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: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 to )
    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:

                        GW620
                        
                                CFBundleIdentifier
                                com.apple.driver.AppleUSBComposite
                                IOClass
                                IOUSBCompositeDriver
                                IOProviderClass
                                IOUSBDevice
                                bDeviceClass
                                0
                                bDeviceSubClass
                                2
                        
    

    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

提交回复
热议问题