title: Can't debug through onReceive() in boot completed receiver
body: <p>Thanks a ton to this site, I have made significant progress with my first Android project.</p>
  
  <p>I'm trying to get the execution suspend in the onReceive() method of a boot completed receiver. Below are my manifest and receiver code.</p>
  
  <p>Android 2.3.3<br>
  API - 10<br>
  IDE - Eclipse<br>
  Running on emulator</p>
  
  <p>Manifest:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.android.demo.notepad3" &gt;
  
  &lt;uses-sdk android:minSdkVersion="10" /&gt;
  
  &lt;uses-permission android:name="android.permission.VIBRATE" /&gt;
  &lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /&gt;
  
  &lt;application android:icon="@drawable/icon" &gt;
      &lt;activity
          android:label="@string/app_name"
          android:name=".ProjectTrackerHomeActivity" &gt;
          &lt;intent-filter &gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
      &lt;activity android:name=".ProjectTrackerEditActivity" /&gt;
  
      &lt;receiver android:name=".ProjectTrackerNotification" /&gt;
  
      &lt;receiver
          android:name=".ProjectTrackerOnBootReceiver" &gt;
          &lt;intent-filter &gt;
              &lt;action android:name="android.intent.action.BOOT_COMPLETED" /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>Receiver:</p>
  
  <pre><code>public class ProjectTrackerOnBootReceiver extends BroadcastReceiver {
  private ProjectTrackerDBAdapter mDbHelper;
  
  @Override
  public void onReceive(Context context, Intent intent) {
      Debug.waitForDebugger();
      AlarmManager
                mgr=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
  
                //I place the break point at line 2, the alarm manager line
  
               // Further code, irrelevant
      }
  </code></pre>
  
  <p>My observations -<br>1. When I run this application in debug mode on eclipse, the break point is not even hit.<br>2. When I run <strong><em>some other application</em></strong> in debug mode, this break point is hit momentarily! But before I can proceed with a step by step execution, the execution resumes. It doesn't stop there.</p>
  
  <p>My reasoning for this behavior is that -<br>1. When I run some other application, since this above app is already installed, it catches the boot complete broadcast and so the breakpoint is hit. (But why doesn't the execution halt at the breakpoint?)<br>2. When I run only this app, it gets installed first and in the time it takes for installation, it misses the boot complete broadcast.</p>
  
  <p>May I please get some assistance with the below queries -<br>1. How can I make the execution halt at the breakpoint without it resuming further?<br>2. Can I somehow run an already installed version of this app on the emulator in debug mode "without having it to get freshly installed" on the emulator every time I run it?<br>
  3. Is there anything else I'm doing wrong or missing something?</p>
  
  <p>Kindly let me know since I really need to debug through onReceive() to catch further application logic bugs. Thanks a lot, folks.</p>