如何停止崩溃时重新启动应用程序并使崩溃可见? [英] How can i stop app from restarting on crash and make crashes visible?

查看:73
本文介绍了如何停止崩溃时重新启动应用程序并使崩溃可见?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,并使用HUAWEI手机进行测试,每当发生崩溃时,应用程序都会重新启动并且日志消失.开发人员选项中是否有任何设置或其他可以使崩溃对话框显示并显示崩溃日志的内容.

I am working on an app and using HUAWEI phone for testing, whenever a crash happen app gets restarted and logs become disappear. Is there any setting in developer option or some thing else that can let crash dialog appears and shows crash logs.

推荐答案

我最近学到了这一点,希望对其他人有帮助.

I learnt this recently, hopefully it helps others out there.

像往常一样调试,但是一旦崩溃并重新启动,则打开Logcat选项卡. 然后,在顶部的Logcat窗口中,您可以选择上一个过程. 应该是这样的:

Debug as you normally would, but once the crash and restart happens open up the Logcat tab. In the Logcat window at the top you can then select your previous process. It should be something like:

com.myapp.app(1234)[死亡]

com.myapp.app(1234)[DEAD]

这将为您提供重启前的日志.

That'll give you the logs before the restart.

这篇关于如何停止崩溃时重新启动应用程序并使崩溃可见?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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