开发时如何禁用Crashlytics [英] How to disable Crashlytics while developing

查看:122
本文介绍了开发时如何禁用Crashlytics的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在开发过程中,有没有简单的方法来将Crashlytics Android SDK关闭?



我不希望每次愚蠢的事情发送崩溃



另一方面我不想评论 Crashlytics.start(),可能会忘记取消注释并提交

解决方案

Marc从Crashlytics这里。在进行调试时,可以通过几种方法来禁用Crashlytics!


  1. 使用不同的android:versionString进行调试和发布版本,然后从Crashlytics Web信息板中为调试版本禁用崩溃报告


  2. 将检查调试标志的if语句中的调用结合到Crashlytics.start()。您可以使用自定义标志或类似于此处提出的方法:如何检查APK是否签名或调试构建?



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 other hand I don't want to comment out Crashlytics.start() and possibly risk forgetting to uncomment it and commit

解决方案

Marc from Crashlytics here. Here's a couple of ways to disable Crashlytics while you are doing your debug builds!

  1. Use a different android:versionString for debug and release builds and then disable crash reporting from the Crashlytics web dashboard for the debug version.

  2. Wrap the call to Crashlytics.start() in an if statement that checks a debug flag. You could use either a custom flag or an approach like the ones proposed here: How to check if APK is signed or "debug build"?

这篇关于开发时如何禁用Crashlytics的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆