firebase异常捕获
按照文档步骤
配置 google-service.json
配置 证书指纹
依赖,plugin等
在代码中主动 throw RuntimeException(),但是控制台始终无法看到日志,
如何开启调试和查看日志呢?
adb shell setprop log.tag.FirebaseCrashlytics DEBUG
adb logcat -s FirebaseCrashlytics
可以进行逐步排查
正常有异常会有
/data/user/0/com.xxxxx/files/.crashlytics. 下有文件
发送成功会有
Crashlytics report successfully enqueued to DataTransport: xxxxx
日志
异常测试
// 记录测试异常
// try {
// throw RuntimeException("tp crash test Runtime " + System.currentTimeMillis())
// } catch (e: java.lang.Exception) {
// Firebase.crashlytics.recordException(e)
// Firebase.crashlytics.log("tp crash test")
// }throw RuntimeException("!!!!tp test crash222222222")
recordException 和throw都测试一下