1. 程式人生 > >判斷當前app是debug還是release

判斷當前app是debug還是release

//判斷當前應用是否是debug狀態

public static boolean isApkInDebug(Context context) {

  try {

         ApplicationInfo info = context.getApplicationInfo();

         return (info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;

        } catch (Exception e) {

             return false;

         }