How to disable Crashlytics during development

后端 未结 28 2601
心在旅途
心在旅途 2020-11-29 15:42

Is there any simple way to turn Crashlytics Android SDK off while developing ?

I don\'t want it to send a crash every time I do something stupid

On the othe

28条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-29 15:46

    If you're worried about BuildConfig.DEBUG not being set up correctly, use ApplicationInfo instead:

    boolean isDebug = ( mAppContext.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE ) != 0;
    Crashlytics crashlytics = new Crashlytics.Builder().disabled( isDebug ).build();
    Fabric.with( uIContext, crashlytics );
    

提交回复
热议问题