Tuesday, February 19, 2013

Setting up Android Debugging on a Nexus 4

February 19, 2013 Posted by Jason Irwin , No comments

My beloved Nexus 4 – seriously, I LOVE the thing! - has inspired me to write some Android Apps. I haven’t used Eclipse in years, and have never written a non-hello-world Android App, so had some teething issues getting started with on-device debugging. Here are a few tips for the uninitiated:

  1. Enabling debugging on Jellybean and above is interesting. Developer Options are not enabled by default and to make them visible you need to go to Settings->About Phone and tap Build number 7 times! You even get a playful message indicating when you are halfway there…
  2. Once you’ve performed step #1, go back to settings on your phone and Developer Options should now be present. Make sure to enable USB debugging.
  3. Your system may recognize your N4, but that doesn’t necessarily mean that it has the driver it needs for debugging.
    1. Typing adb devices in the command prompt from the ADT’s sdk\platform-tools folder will enumerate the devices on your system. If you see one, ignore this step
    2. Otherwise, go to device manager and update your driver (as usual I take no responsibility if you break something here. If you got this far, I assume you know how to update a driver…). The correct driver should be available in your ADT folder under sdk\extras\google\usb_driver
  4. You don’t need to do anything special in Eclipse. I fiddled with settings for a little while before realizing that simply clicking on debug will load up your APK on your device. Pretty seamless stuff