Monday, July 18, 2011

How to Debug or Run Android application (.apk) on your own Android device from Eclipse

outcome: Click debug, Eclipse will install and run the application from your phone and not virtual device.

Requirement:
Window 7
Eclipse
sync cable (from pc to your phone)

1. Change your phone setting to debugging mode
(Look at your phone)
  • Application->Settings->Applications
    Check "Unknown sources" (unchecked by default for security purposes)
  • Application->Settings->Applications->Development
    Check "USB debugging", I checked "Stay awake" too.
    make sure my phone stay awake when i'm working... train my phone not to be lazy!!! lol~~

2. Make your USB detectable by your pc.
(Although your device might show connected to your pc, if you check on Eclipse debugger list, you can't find your device, some driver is required to be install)
    1. In Eclipse, go to Window->Android SDK and AVD Manager->Available Packages->Third party Add-ons->Google Inc. (dl-ssl.google.com)->
    2. Only Check on Google USB Driver package, revision x.
    3. Click "Install selected".
    1. In Windows,Go to Start->Control Panel->Device Manager
    2. Look for your devices, I'm using Nexus S, so i find my device at Other Devices->Nexus S
    3. Click on the device, and click Update Driver Software at the top
    4. Choose "Browse my computer for driver software"
    5. look for the Google USB Driver package that you just download from Eclipse located at \google-usb_driver\
      (eg..C:\Android SDK\android-sdk-windows\google-usb_driver)
    6. Check or no check subfolder, up to u la. (I checked)

  • Last part, go back Eclipse to check if your device is available in the list.
    1. Go Run->Debug Configurations...
    2. Target tab->Deployment Target Selection Mode set to Manual
    3. Click Debug (At this point, make sure device is connected to pc, debugging mode from your device is ON)
3.Make your application debuggable
(Back to your project)
  • Before you debug
    1. Go to AndroidManifest.xml of your application
    2. Select Application tab
    3. Debuggable field select "true"



That is it, try debug your project, .apk is now installed and run on your device.

3 comments:

  1. This is one of the brilliant post.Your blog is providing out standing performance.This is one of the great post.
    Android app developers

    ReplyDelete
  2. Android Applications Development : As a developer, you need to perform on venture of different market verticals with different level of complexness. In such cases, it is always recommended to fragment the large programs into small and controllable items that can be managed with convenience. This will allow you to rule the programs, fast running of programs, eat lowest sources while saving your time. Last but not the least, never question your capabilities. If you are assured enough of your capabilities, all you need is to put into perform along with your creativeness, to create a unique, feature-rich and user-friendly app.

    ReplyDelete