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

前端 未结 30 2583
庸人自扰
庸人自扰 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:22

    I'm one of the founders of Bugsnag which we designed for exactly this purpose. Bugsnag automatically captures unhandled exceptions in Android apps and sends them to our dashboard, where you can prioritize fixes and dive into diagnostic information.

    Here are some important things to consider when selecting or building a crash reporting system, along with some code snippets:

    • Detects unhandled exceptions automatically (example code)
    • Collects diagnostic data such as memory usage, device info, etc (example code)
    • Effectively groups crashes together by root cause
    • Allows you to track actions the user took before each crash to help reproduce (example code)

    If you want to see some best practices around crash handling/reporting on Android you can check out the full source code for Bugsnag's crash reporting library which is fully open source, feel free to tear this apart and use it in your own applications!

提交回复
热议问题