Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i stop app from restarting on crash and make crashes visible?

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.

like image 1000
Zubair Akber Avatar asked Jul 19 '19 09:07

Zubair Akber


2 Answers

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

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)[DEAD]

That'll give you the logs before the restart.

like image 181
JJ Du Plessis Avatar answered Sep 28 '22 04:09

JJ Du Plessis


You can run the app Debugger mode and keep a break point in the activity where the crash occurs and navigate by going to next line using F8 until you encounter the crash.

like image 25
the_lone_wolf Avatar answered Sep 28 '22 02:09

the_lone_wolf