How to crash an Android app programmatically?

后端 未结 13 1493
遥遥无期
遥遥无期 2021-02-05 00:37

I want to test out crash report using acra but the first step is I need to simulate a fatal crash in Android using code.

Any idea?

13条回答
  •  一整个雨季
    2021-02-05 00:53

    If you are using firebase crashlytics, then there is a very easy way to do this. Mentioned in their document also.

    val crashlytics = FirebaseCrashlytics.getInstance()
    crashlytics.log("my message")
    

提交回复
热议问题