android 台设备离线时崩溃报告器离线

crash reporter offline for android device offline

我有一个设备 android,例如 friendly arm,这是离线的。我需要查看此设备的崩溃情况。例如,崩溃保存在 SD 卡中。 我可以离线使用 firebase crashlytics 并保存在文件中吗?或使用其他图书馆。我需要一份完整的报告,例如内存、存储、线路崩溃等

从技术上讲,您可以实现这种机制来自己跟踪崩溃日志。 查看以下要在 Application class:

中处理的代码
import android.app.Application

class TestApp : Application() {
    override fun onCreate() {
        super.onCreate()

        val exceptionHandler = SimpleExceptionHandler()
        Thread.setDefaultUncaughtExceptionHandler(exceptionHandler)
    }
}


class SimpleExceptionHandler : Thread.UncaughtExceptionHandler {
    override fun uncaughtException(thread: Thread, exc: Throwable) {
        // Log your exception here to files, database, etc together with the device status like RAM, processes, network condition that the crash point 
    }
}

您可以选择存储信息的方式,如文本文件、数据库等