24
22

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Crashlyticsをデバッグビルドでは無効化

Last updated at Posted at 2015-05-29

AndroidにCrashlyticsを組み込んだところ、デバッグ中のぬるぽとかもガンガンアップロードされてしまい、困ったので調べたところ

MyApplication.java
public class MyApplication extends Application {
     @Override
     public void onCreate(){
         super.onCreate();
         
-        Fabric.with(this, new Crashlytics());
+        Crashlytics crashlytics = new Crashlytics.Builder().disabled(BuildConfig.DEBUG).build();
+        Fabric.with(this, crashlytics);

自動生成されたコードを↑のようにすれば、
デバッグ中にぬるぽで落ちたのとかは、サーバにアップロードされない。

#Thanks to: http://stackoverflow.com/questions/16986753/how-to-disable-crashlytics-while-developing/27191197#27191197

24
22
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
24
22

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?