Java tutorial
//package com.java2s; import android.os.Debug; public class Main { public static boolean isDebuggerAttached() { return (Debug.isDebuggerConnected()) || (Debug.waitingForDebugger()); } }