Android在每次运行时保存日志以获取崩溃报告 [英] Android saving logs on every run for crash report

查看:615
本文介绍了Android在每次运行时保存日志以获取崩溃报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发一个android应用.我注意到一个非常罕见的错误,导致我的应用程序崩溃.不幸的是,我的智能手机从未出现在我的电脑上.因此,有没有一种方法可以在我的应用程序启动时自动将所有日志(尤其是抛出的运行时异常)保存到文件中,以便我可以将此文件复制到PC并分析错误?该文件应在我的应用程序的每次启动时均被覆盖,以便仅包含上次运行的日志...我该如何实现?

I'm currently developing an android app. I noticed a very rare error which leeds to a crash of my app. Unfortunately, I had my smartphone never connected to my pc when it occured. So, is there a way to automatically save all logs (and especially the thrown runtimeexceptions) to a file when my app starts, so that I can copy this file to my pc and analyse the error? The file should be overwritten on every start of my app, so that it contains only the logs of the last run... How can I achieve that?

致谢

推荐答案

在这里,我将讨论本文中第二个答案的解决方案(作者:rrainn): 如何从Android应用程序中获取崩溃数据?

I'm going with the solution of the second answer in this post here ( by rrainn): How do I obtain crash-data from my Android application?

这篇关于Android在每次运行时保存日志以获取崩溃报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆