package basic.debug; import android.content.Context; import android.content.pm.ApplicationInfo; /** * Created by fanwang on 12/29/16. * this util main for debug related */ public class DebugUtil { /** * 判断程序是否debug * @context 上下文,建议使用全局上下文 * */ public static boolean isApkDebugable(Context context) { try { ApplicationInfo info= context.getApplicationInfo(); return (info.flags&ApplicationInfo.FLAG_DEBUGGABLE)!=0; } catch (Exception e) { } return false; } }