应用程序被杀死时如何调试 [英] How to debug app when it's killed

查看:21
本文介绍了应用程序被杀死时如何调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序在某些活动上有一个错误:当它重新启动时(当它被杀死然后用多任务程序再次打开时),它崩溃了.我认为这与我的单身人士有关,但我不确定.我想查明问题,但我无法调试,因为当我终止应用程序时调试器会停止(我使用的是 adb shell am kill )..>

有谁知道我如何调试这个问题?(或者给我一个提示,我的问题可能是什么)

解决方案

我会使用 DDMS(Dalvik Debug Monitor Server (DDMS) 来捕获堆栈跟踪等.在您杀死并重新启动我们的应用程序后.

(仅供参考:它已经与 Android 工具集的其余部分一起安装)

虽然它不允许您通过 VS/XS 调试您的应用程序,但它可以帮助您确定导致问题的应用程序区域.从那里我将在故障区域周围添加日志记录(即老式 printf 样式调试)

来自 Xamarin Studio:

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)

解决方案

I would use DDMS (Dalvik Debug Monitor Server (DDMS) to capture the stack trace, etc.. after your kill and restart our app.

(FYI: It is already installed along with the rest of the Android toolset)

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

To launch from Visual Studio:

From Xamarin Studio:

这篇关于应用程序被杀死时如何调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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