Android:在真实设备上崩溃(重新启动)之前检索 logcat
我正在开发一个应用程序,在真实设备上进行测试期间,我发现它会崩溃并导致手机重新启动(我担心……)
有什么方法可以在手机重新启动之前检索 logcat 作为 logcat手机启动时似乎会重置。
提前致谢。
I am developing an application and during my testing on a real device I have found that it will crash and cause the phone to reboot (worrying I know...)
Is there any way I retrieve the logcat from before the phone rebooted as the logcat seems to reset when the phone boots up.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
使用 http://code.google.com/p/acra/,这是一个很棒的工具lib 将崩溃报告发送到 google 表单,包括。堆栈跟踪。我在我的应用程序中使用它并且运行良好。如果您在实施过程中遇到任何困难,请告诉我。
阅读http://code.google.com/p/acra/wiki/ACRAHowTo,设置很容易。
Use http://code.google.com/p/acra/, which is a great lib to send crash reports to a google form incl. stack trace. I use it in my app and works nicely. Let me know if you have any difficulties implementing it.
Read the http://code.google.com/p/acra/wiki/ACRAHowTo, it's easy to setup.
来自slashfoo 的博客,(检查 logcat 页面以获取确切的语法)
连接您的计算机以在后台启动 logcat 进程。
adb shell nohup logcat -f /dev/[your sdcard] -n60 -r3600
虽然这意味着 logcat 将保存到 sdcard 但每次重新启动时,您必须再次执行该过程。
From slashfoo's blog, (check the logcat page for exact syntax)
hook up your computer to start off the logcat process in the background.
adb shell nohup logcat -f /dev/[your sdcard] -n60 -r3600
Although it means logcat will be saved to the sdcard but every time you reboot, you must perform the procedure again.
最简单的方法:
从 Market 免费获取 aLogrec。
该应用程序将日志保存到 SD 卡。
Easiest way:
Get aLogrec from Market for free.
This app saves the logs to sdcard.
使用 alogrec 程序。它将日志写入SD卡,并在重新启动后自动恢复。
Use the alogrec program. It writes the log to the SD card, and will automatically resume after rebooting.
被 Google 收购的 Fabric 在 2019 年进行了更新,在远程日志记录应用程序崩溃方面做得非常出色。集成到应用程序中很简单,而且是免费的(至少在我使用它的任何级别)。
它对于发现我的应用程序中的缺陷非常有价值。
https://www.fabric.io
Updating for 2019, Fabric, which was purchased by Google, does an excellent job of remote logging app crashes. Integration into the app was simple, and it is free (at least at whatever level I'm using it).
It has been extremely valuable to finding defects in my apps.
https://www.fabric.io
尝试打开终端/命令提示符并在其中发出此命令:
adb -d logcat
这应该会向您转储一个实时版本的 logcat,您可以通过阅读来查找问题
Try to open a terminal/command prompt and issue this in it :
adb -d logcat
This should dump you a live version of the logcat you could read to find the problem