有没有简单的方法可以在开发时关闭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!
使用其他android:versionString进行调试和发布版本,然后从Crashlytics Web仪表板禁用调试版本的崩溃报告.
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()的调用.您可以使用自定义标志,也可以使用此处建议的方法:如何检查APK是否已签名或调试构建"?
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
发布评论