Friday, October 5, 2012

Nexus 7 - Setting up USB debugging

I recently bought a ASUS Nexus 7 tablet and I'm very pleased with it. I'm particularly happy that it came with Android 4.1 (Jellybean) because I'm interested in using it as a development device for web and apps.

I was excited to learn that by plugging my tablet into my computer I can get full access to Chrome developer tools. The setup was just a little more involved than I had planned.  It's hard to say if everyone will encounter these same hurdles, but the following sequence of events got mine working!

Setup Nexus 7 for Chrome USB debugging:

On Nexus 7:
- In Chrome settings, enable USB debugging
- In Device Settings -> Developer Options -> enable USB debugging
- Device Settings -> Storage -> Settings -> USB computer connection -> enable MTP

On PC:
- Plug in device
- Install Java JDK from oracle
- (optional) Download and install Eclipse Classic 4.2.1 or newer
- Install Android SDK
- Launch Android SDK Manager ( start as administrator! )
- Install Adroid 4.1, all tools, and the google usb driver

Download drivers from ASUS site:
- http://support.asus.com/Download.aspx?SLanguage=en&m=Nexus+7&p=20&s=16
- select the 'Global' download option ( middle of three )

In Windows device manager locate the Nexus 7 - generally under 'Other devices'
- 'Update Driver Software' -> browse to local copy of downloaded drivers & install
- Device should now be listed as an android phone

Check Device Connectivity:
- Open command prompt and change directory to C:\Program Files (x86)\Android\android-sdk\platform-tools  ( or the location of adb.exe )
- Execute command: 'adb devices' - the device should be listed. if not you have failed somewhere

Set up Chrome debugging:
- Execute:  'adb forward tcp:9222 localabstract:chrome_devtools_remote'
- Go to Chrome, navigate to localhost:9222 -> tabs on nexus chrome should be visible for debugging

And hopefully that will get you there...

Update:  If you're still having trouble, check that the 'USB Computer Connection' type is set to PTP.  This setting can be located in Settings -> Storage -> (menu) USB Computer Connection.

No comments:

Post a Comment