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

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

问题描述

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

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天全站免登陆