title: Android with jdb confusion using waitForDebugger
body: <p>I'd like to debug my Android application on my device (Nexus One - not the emulator) using the command line.</p>
  
  <p>I'm confused at how to set a breakpoint using jdb in combination with <code>android.os.Debug.waitForDebugger</code>.</p>
  
  <p>Say I put the following code in my main activity <code>onCreate</code>:</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      android.os.Debug.waitForDebugger();
      int j = 10;
      int r = j;
  }
  </code></pre>
  
  <p>Using <code>ddms</code> I can see that my application is waiting for the debugger (red bug icon) when I start it.</p>
  
  <p>However, I don't understand how to set a breakpoint after the <code>waitForDebugger()</code> call so that I can start stepping.</p>
  
  <p>Obviously just attaching <code>jdb</code> is going to immediately continue running the app without stopping.</p>
  
  <p>e.g.</p>
  
  <pre><code>jdb -attach localhost:8700
  </code></pre>
  
  <p>Is there way to preset breakpoints prior to running <code>jdb</code> or a way to start <code>jdb</code> set breakpoints and then attach? </p>