杀死应用程序时如何调试 [英] How to debug app when it's killed
问题描述
我的应用程序在某些活动上存在错误:重新启动时(被杀死,然后使用多任务程序再次打开时),它崩溃了.我认为这与我的单身人士有关,但我不确定.我想指出问题所在,但由于调试器在杀死应用程序时停止运行,所以无法调试(我正在使用adb shell am kill <package-name>
).
My app has a bug on certain activities: when it restarts (when it's killed and then opened again with multitasker), it crashes. I assume it has something to do with my singleton, but I'm not sure. I'd like to pinpoint the problem, but I can't debug since the debugger stops when I kill the application (I'm using adb shell am kill <package-name>
).
有人知道我该如何调试此问题? (或者给我提示我可能会遇到的问题)
Does anyone know how I can debug this problem? (Or give me a hint what my problem might be for that matter)
推荐答案
在杀死并重新启动我们的应用程序后,我将使用DDMS(Dalvik调试监视器服务器(DDMS)来捕获堆栈跟踪等).
I would use DDMS (Dalvik Debug Monitor Server (DDMS) to capture the stack trace, etc.. after your kill and restart our app.
(仅供参考:它已经与其他Android工具集一起安装)
(FYI: It is already installed along with the rest of the Android toolset)
虽然它不允许您通过VS/XS调试应用程序,但它可以帮助您锁定引起问题的应用程序区域.从那里,我将在问题区域周围添加日志记录(即老式的printf
样式调试)
While it is not going to allow you to debug you app via VS/XS, it can help you pin the area of your app that is the cause. From there I would add logging around the trouble area (i.e. the old-fashion printf
style debugging)
http://developer.android.com/tools/debugging/ddms.html
要从Visual Studio启动,请执行以下操作:
To launch from Visual Studio:
从Xamarin Studio:
From Xamarin Studio:
这篇关于杀死应用程序时如何调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!