欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Android 中判断 当前应用是 debug 还是release

程序员文章站 2022-05-04 07:51:10
...

判断当前应用是否是debug状态

//判断当前应用是否是debug状态
public static boolean isApkInDebug(Context context) {
    try {
        ApplicationInfo info = context.getApplicationInfo();
        return (info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
    } catch (Exception e) {
        return false;
    }
}
相关标签: 安卓知识