应用程序在 iPad 模拟器中崩溃,没有有用的控制台信息
请原谅这里的新手 - 我正在模拟器中运行一个应用程序,有时当它崩溃时,它会在控制台中发布有用的信息,其他时候则绝对不会。当它什么也没发布时,应该采取哪些好的步骤来开始追踪崩溃的原因?
please forgive the total newbie here - I am running an app in the simulator, and sometimes when it crashes it posts useful info in the console, other times absolutely nothing. When it posts nothing, what would be good steps to follow to start tracking down the cause of the crash?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
首先,崩溃后打开调试器并查看堆栈跟踪。
除此之外,当出现那些模糊的错误访问错误时,您可以为可执行文件启用 NSZombieEnabled 。
带有 stacktrace 的调试器(左上角窗口),XCode3
Stacktrace Xcode4
First of all open the debugger after the crash and look at the stacktrace.
In addition to that you could enable NSZombieEnabled for the executable when those vague bad access errors show up.
Debugger with stacktrace(top left window), XCode3
Stacktrace Xcode4
我可以使用我们的应用程序不断重现这种行为。它使用 ARC,所以我很确定没有任何东西会被过度释放,并且我们启用了僵尸。 Xcode 将显示“已暂停”而不是显示线程列表,“继续”按钮处于活动状态,但不执行任何操作,并且在 (gdb) 提示符上输入 bt 会显示 否堆栈。
这让我发疯!
I can continuously reproduce this kind of behavior with our app. It uses ARC so im pretty sure nothing gets over released, and we have zombies enabled. Xcode will say "Paused" instead of displaying a list of threads, the "Continue" button is active, but doesn't do anything, and entering bt on the (gdb) prompt says No stack.
This is driving me crazy!
确定应用程序崩溃的事件。例如,如果应用程序在单击 UIButton 时崩溃,您可以在操作上放置断点并单步执行代码行以查看崩溃发生在哪一行。有时,当应用程序崩溃时没有崩溃日志时,通过这种方法进行调试确实很有帮助。
我想这是一个内存问题。
Determine on what event the app is crashing. For exapmple if the app is crashing on the click of a UIButton, you can put a breakpoint on the action and step through code lines to see on which line the crash happens. Sometimes when there is no crash log on the crash of app, debugging through this method, does prove to be helpful.
I suppose this is a memory issue.
有时它也会发生在我身上..应用程序崩溃,日志中没有发布任何错误消息..95%的时间是因为我不会释放某些东西或将释放某些东西并访问它(这通常会创建日志)...检查您的代码并查看是否正确释放并在需要时使用自动释放选项...
sometimes it happens to me as well.. the app crashes without any error message getting posted in the logs.. 95% of the time it is because I would be not be releasing something or would be releasing something and accessing it( which would usually create a log)... go through your code and see whether you are releasing properly and using autorelease option where needed...