判斷Android 當前版本是否為debug版本

netcorner發表於2018-06-03
public static boolean isDebugVersion(Context context) {
   try {
      ApplicationInfo info = context.getApplicationInfo();
      return (info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
   } catch (Exception e) {
      e.printStackTrace();
   }
   return false;
}
 

 

相關文章