直接调用BuildConfig.DEBUG 如果是true表示 debug
用下面的代码:
public static boolean isApkDebugable(Context context) {
try {
ApplicationInfo info = context.getApplicationInfo();
return (info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
} catch (Exception e) {
return false;
}
}
在客户端的第一个Activity的onCreate方法中执行一下即可