title: How do I debug when using ionic emulate android
body: <p>I created an application using ionic:</p>
  
  <pre><code>ionic start MyFirstApp blank
  cd MyFirstApp
  ionic serve
  ionic platform add android
  ionic build android
  ionic emulate android
  </code></pre>
  
  <p>Everything is successful except the emulator step. The emulator boots up, but I get "Unfortunately, MyFirstApp has stopped". Everything brand new straight out of the box, no changes to code.</p>
  
  <p>What next? How do I debug what has gone wrong?</p>
  
  <p><strong>EDIT</strong>
  This is the output displayed when I call <code>ionic build android</code>:</p>
  
  <pre><code>    C:\Users\Colin\Documents\Ionic\MyFirstApp&gt;ionic build android
  add to body class: platform-android
  Running command: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\cordova\build.bat
  Buildfile: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\build.xml
  
  -set-mode-check:
  
  -set-debug-files:
  
  -check-env:
   [checkenv] Android SDK Tools Revision 23.0.2
   [checkenv] Installed at C:\Program Files\Eclipse\adt-bundle-windows-x86_64-20140702\sdk
  
  -setup:
       [echo] Project Name: MyFirstApp
    [gettype] Project Type: Application
  
  -set-debug-mode:
  
  -debug-obfuscation-check:
  
  -pre-build:
  
  -build-setup:
  [getbuildtools] Using latest Build Tools: 20.0.0
       [echo] Resolving Build Target for MyFirstApp...
  [gettarget] Project Target:   Android 4.4.2
  [gettarget] API level:        19
       [echo] ----------
       [echo] Creating output directories if needed...
       [echo] ----------
       [echo] Resolving Dependencies for MyFirstApp...
  [dependency] Library dependencies:
  [dependency]
  [dependency] ------------------
  [dependency] Ordered libraries:
  [dependency]
  [dependency] ------------------
       [echo] ----------
       [echo] Building Libraries with 'debug'...
  
  nodeps:
  
  -set-mode-check:
  
  -set-debug-files:
  
  -check-env:
   [checkenv] Android SDK Tools Revision 23.0.2
   [checkenv] Installed at C:\Program Files\Eclipse\adt-bundle-windows-x86_64-20140702\sdk
  
  -setup:
       [echo] Project Name: MyFirstApp
    [gettype] Project Type: Android Library
  
  -set-debug-mode:
  
  -debug-obfuscation-check:
  
  -pre-build:
  
  -build-setup:
  [getbuildtools] Using latest Build Tools: 20.0.0
       [echo] Resolving Build Target for MyFirstApp...
  [gettarget] Project Target:   Android 4.4.2
  [gettarget] API level:        19
       [echo] ----------
       [echo] Creating output directories if needed...
       [echo] ----------
       [echo] Resolving Dependencies for MyFirstApp...
  [dependency] Library dependencies:
  [dependency] No Libraries
  [dependency]
  [dependency] ------------------
  
  -code-gen:
  [mergemanifest] Found Deleted Target File
  [mergemanifest] Merging AndroidManifest files into one.
  [mergemanifest] Manifest merger disabled. Using project manifest only.
       [echo] Handling aidl files...
       [aidl] No AIDL files to compile.
       [echo] ----------
       [echo] Handling RenderScript files...
       [echo] ----------
       [echo] Handling Resources...
       [aapt] Found new input file
       [aapt] Generating resource IDs...
       [echo] ----------
       [echo] Handling BuildConfig class...
  [buildconfig] No need to generate new BuildConfig.
  
  -pre-compile:
  
  -compile:
       [echo] Creating library output jar file...
  
  -post-compile:
  
  -obfuscate:
  
  -dex:
       [echo] Library project: do not convert bytecode...
  
  -crunch:
     [crunch] Crunching PNG Files in source dir: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\CordovaLib\res
     [crunch] To destination dir: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\CordovaLib\ant-build\res
     [crunch] Crunched 0 PNG files to update cache
  
  -package-resources:
       [echo] Library project: do not package resources...
  
  -package:
       [echo] Library project: do not package apk...
  
  -post-package:
  
  -do-debug:
       [echo] Library project: do not create apk...
  [propertyfile] Updating property file: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\CordovaLib\ant-build\build.prop
  [propertyfile] Updating property file: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\CordovaLib\ant-build\build.prop
  [propertyfile] Updating property file: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\CordovaLib\ant-build\build.prop
  [propertyfile] Updating property file: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\CordovaLib\ant-build\build.prop
  
  -post-build:
  
  debug:
  
  -code-gen:
  [mergemanifest] Found Deleted Target File
  [mergemanifest] Merging AndroidManifest files into one.
  [mergemanifest] Manifest merger disabled. Using project manifest only.
       [echo] Handling aidl files...
       [aidl] No AIDL files to compile.
       [echo] ----------
       [echo] Handling RenderScript files...
       [echo] ----------
       [echo] Handling Resources...
       [aapt] Found Deleted Target File
       [aapt] Generating resource IDs...
       [echo] ----------
       [echo] Handling BuildConfig class...
  [buildconfig] No need to generate new BuildConfig.
  
  -pre-compile:
       [echo] Set jars path to: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\CordovaLib\ant-build\classes.jar
  
  -compile:
      [javac] Compiling 2 source files to C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\ant-build\classes
  
  -post-compile:
  
  -obfuscate:
  
  -dex:
        [dex] input: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\ant-build\classes
        [dex] input: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\CordovaLib\ant-build\classes.jar
        [dex] Using Pre-Dexed classes-3a52ec06bbf9dc987d551c9695e3393a.jar &lt;- C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\CordovaLib\ant-build\classes.jar
        [dex] Found Deleted Target File
        [dex] Converting compiled files and external libraries into C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\ant-build\classes.dex...
         [dx] Merged dex A (12 defs/8.7KiB) with dex B (209 defs/317.1KiB). Result is 221 defs/396.2KiB. Took 0.2s
  
  -crunch:
     [crunch] Crunching PNG Files in source dir: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\res
     [crunch] To destination dir: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\ant-build\res
     [crunch] Crunched 0 PNG files to update cache
  
  -package-resources:
       [aapt] Found Deleted Target File
       [aapt] Creating full resource package...
  
  -package:
  [apkbuilder] Found Deleted Target File
  [apkbuilder] Creating MyFirstApp-debug-unaligned.apk and signing it with a debug key...
  
  -post-package:
  
  -do-debug:
   [zipalign] Running zip align on final apk...
       [echo] Debug Package: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\ant-build\MyFirstApp-debug.apk
  [propertyfile] Updating property file: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\ant-build\build.prop
  [propertyfile] Updating property file: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\ant-build\build.prop
  [propertyfile] Updating property file: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\ant-build\build.prop
  [propertyfile] Updating property file: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\ant-build\build.prop
  
  -post-build:
       [move] Moving 1 file to C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\ant-build
       [move] Moving 1 file to C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\CordovaLib\ant-build
  
  debug:
  
  BUILD SUCCESSFUL
  Total time: 4 seconds
  Using apk: C:\Users\Colin\Documents\Ionic\MyFirstApp\platforms\android\ant-build\MyFirstApp-debug-unaligned.apk
  </code></pre>
  
  <p><strong>EDIT 2</strong> This is the output from <code>android list avd</code></p>
  
  <pre><code>Available Android Virtual Devices:
      Name: Nexus7
    Device: Nexus 7 (Google)
      Path: C:\Users\Colin\.android\avd\Nexus7.avd
    Target: Android 4.4W (API level 20)
   Tag/ABI: android-wear/armeabi-v7a
      Skin: WVGA800
  </code></pre>