Show me the code! – By Davanum Srinivas

December 4, 2007

Android Quick Tip – 1 liner to make the VM wait for debugger to connect

Filed under: android — Davanum Srinivas @ 6:46 am

Add this line in your code and when you run the application hits this method, it will wait till you connect with a debugger.


android.os.Debug.waitForDebugger();

Which port you ask? run the “ddms” utility and see for yourself which port your application is waiting on.

3 Comments »

  1. you can also check the option in your development settings.

    Comment by wicketthings — December 5, 2007 @ 1:19 am

  2. […] I am narrowing down the camera problems by remote debugging with Eclipse. Please see the following articles on how to setup remote debugging for Android/Cyanogenmod: Loading source in eclipse – CyanogenMod Wiki Using Eclipse | Android Open Source Android Quick Tip – 1 liner to make the VM wait for debugger to connect Show me the code! &#82… […]

    Pingback by [DEV] Continuing Triumph ICS Development - Page 17 - Android Forums — February 15, 2012 @ 4:58 pm

  3. Hmm is anyone else experiencing problems with the pictures
    on this blog loading? I’m trying to figure out if
    its a problem on my end or if it’s the blog. Any feed-back would be greatly appreciated.

    Comment by www — September 18, 2013 @ 4:26 am


RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.