Monday, 2 July 2012

How to debug on an Android device in Eclipse

 You have your application written and it works great on the emulator, but you want to try it on a real device. Here's how. The original article is here.

Install the Google USB Driver

Open the Android SDK Manager (from Eclipse, select Window > Android SDK Manager)

Make sure that the Sort By: radio selection is set to API Level and the Updates/New option is selected.

The last folder in the Packages tree view should be titled Extras. In that folder is an item called Google USB Driver. Check that and select "Install packages...". Agree to the terms and conditions and select Install.

Once that's complete, close the Android SDK Manager window.

Set up your Device for Development

Turn on USB Debugging on your device.
For Android versions less than 4.0, the setting is in Settings > Applications > Development
For 4.0 and above it lives in Settings > Developer Options

Install the OEM USB Driver

Here comes the tricky part.

Connect your device over USB.

Open up Computer (Start > Computer in Windows 7)

Right click Computer in the left pane and click Manage in the context menu.

A Computer Management window will appear. Click on Device Manager in the tree view in the left pane. It's under the System tools item.

Your device should be in this list, under Other. Right click it and select Update Drivers. From here you need to manually navigate to the <android-sdk-root>/extras/google/usb_driver folder.

Once selected the driver will install and you'll be able to debug using your device! 

No comments:

Post a Comment