How do I obtain crash-data from my Android application?

前端 未结 30 2552
庸人自扰
庸人自扰 2020-11-22 01:10

How can I get crash data (stack traces at least) from my Android application? At least when working on my own device being retrieved by cable, but ideally from any instance

30条回答
  •  悲哀的现实
    2020-11-22 01:28

    Google Firebase is Google's latest(2016) way to provide you with crash/error data on your phone. Include it in your build.gradle file :

    compile 'com.google.firebase:firebase-crash:9.0.0'
    

    Fatal crashes are logged automatically without requiring user input and you can also log non-fatal crashes or other events like so :

    try
    {
    
    }
    catch(Exception ex)
    {
        FirebaseCrash.report(new Exception(ex.toString()));
    }
    

提交回复
热议问题