Feb 052010
 

Fixed! I can now use ADB to talk to the phone in OSX! Turns out that it’s a problem with the way that LG designed the phone’s composite device vs the way that OSX recognizes composite devices. USB devices all present a class and a subclass to the OS when they’re plugged in. For composite devices the class is 0 and the subclass can be 0 (legacy) or 16(current.) Linux plays a little fast and loose, and assumes that anything with a class of 0 is a composite device, but OSX is a little more stringent. It looks for the subclass to be proper. LG made the subclass on the GW620 a 2. Not 0 or 16 like the USB spec says, but 2. Totally non-standard. So, I modified the Info.plist for OSX’s composite device driver so that it would also accept 2. Problem solved. :) Here’s what you need to do to make it work:

  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″
  8. 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>
    
  9. “sudo diskutil repairpermissions /” and let it finish
  10. “sudo touch /System/Library/Extensions” and wait a few mins for the extension reindexing to finish
  11. “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

  5 Responses to “Getting ADB access to the LG GW620 on MacOS”

  1.  What if I want to do this with another type of phone like say the Nexus One? 
    What should I change the bDeviceSubClass value to?What would I change the key name from “IOUSBComposite” to?

    • AFAIK the Nexus One should have standard USB subclasses, so it should “Just work” without the above modifications.  If it’s not working for you there may be something else going on.
      Do you have USB Debugging enabled in the settings of the phone?

      • I do have debugging enabled.  The problem I am running into is that I am using adb in my continuous integration system (Jenkins) and the nexus one & adb play well together for a while but then suddenly adb wont be able to connect to the phone.  I have to end up unplugging the phone and replugging it back in to get the phone to connect to adb.  Its very annoying.

        •  I think what I am going to try to do to keep the adb connection alive in Jenkins is run a job that executes the ‘adb status-window’ command and hope that adb stays alive. This job will get interrupted when my other jobs run but I will restart the ‘adb status-window’job once the other jobs have concluded.

  2. WARNING THIS COULD CAUSE PROBLEMS.

    Trying this on a Mountain Lion mid 2009 MBP leads to an error about that System Extension, and the internal ketyboard and mouse will stop working.

    Luckily in Mac safe boot they work again so you can roll back to the backup copy of the .plist file you took.

    Not sure why, I followed it exactly. Anyway beware unless you know what you’re doing.

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>