Here you can find the source of isDebuggable(Context context)
public static boolean isDebuggable(Context context)
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; public class Main { public static boolean isDebuggable(Context context) { PackageManager pm = context.getPackageManager(); try {//w w w . j a v a 2s . co m ApplicationInfo info = pm.getApplicationInfo( context.getPackageName(), 0); return (info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0; } catch (PackageManager.NameNotFoundException e) { } return true; } }