如何在开发过程中禁用Crashlytics [英] How to disable Crashlytics during development

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

问题描述

有没有简单的方法可以在开发时关闭Crashlytics Android SDK?

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

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

On the other hand I don't want to comment out Crashlytics.start() and possibly risk forgetting to uncomment it and commit

推荐答案

此处来自Crashlytics.在进行调试构建时,有两种禁用Crashlytics的方法!

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

  1. 使用其他android:versionString进行调试和发布版本,然后从Crashlytics Web仪表板禁用调试版本的崩溃报告.

  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.

在检查调试标志的if语句中包装对Crashlytics.start()的调用.您可以使用自定义标志,也可以使用此处建议的方法:

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天全站免登陆