xcode iOS 模拟器崩溃日志
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11227519/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
iOS Simulator Crash Logs
提问by Dustin
When I use the iOS simulator and the app crashes, I can't find the crash logs. I've been looking all over the internets and can't figure out how to enable them. I know I can just run on an actual device and get the crash logs that way, but the bug I'm trying to fix right now tends to cause the program to be hung in the debugger. Then there's no qlaunchsuccess packet sending and it's a huge pain, especially when I have to run the program over and over. The only advice I've been able to find says the use CrashReporterPrefs, but a search of my hard drive reveals nothing named something even close to this. I've also dug into the package contents of XCode and the files of the iOS simulator. The iOS simulator has a crash logs folder, but it is empty. Anyone know how to get this working? Thanks.
当我使用iOS模拟器并且应用程序崩溃时,我找不到崩溃日志。我一直在寻找互联网,但不知道如何启用它们。我知道我可以在实际设备上运行并以这种方式获取崩溃日志,但是我现在正在尝试修复的错误往往会导致程序挂在调试器中。然后没有 qlaunchsuccess 数据包发送,这是一个巨大的痛苦,尤其是当我必须一遍又一遍地运行程序时。我能找到的唯一建议是使用 CrashReporterPrefs,但搜索我的硬盘驱动器发现没有任何名称甚至接近于此。我还深入研究了 XCode 的包内容和 iOS 模拟器的文件。iOS 模拟器有一个崩溃日志文件夹,但它是空的。有谁知道如何让这个工作?谢谢。
采纳答案by Dan F
A Crash log is just an output of what the debugger already gives you. When you are running in the simulator attached to the debugger, and you hit the crash, you can view the back trace information in the debug navigator (default key binding is cmd+5)
崩溃日志只是调试器已经为您提供的输出。当你在调试器附带的模拟器中运行,遇到crash时,可以在调试导航器中查看回溯信息(默认键绑定是cmd+5)
回答by
- Run your App with Xcode to install the App to iOS Simulator
- Launch your App on Simulator without Xcode
- reproduce steps for crash
the Crash log should show up under this directory
~/Library/Logs/DiagnosticReports/
- 使用 Xcode 运行您的应用程序以将应用程序安装到 iOS 模拟器
- 在没有 Xcode 的情况下在模拟器上启动您的应用程序
- 重现崩溃的步骤
崩溃日志应该显示在这个目录下
〜/图书馆/日志/诊断报告/
回答by Gerard
It appears if you aren't running Xcode (mine is 4.5.2) but just the simulator (mine is 6.0) that when an app crashes it does save a crash report. To view it bring up the Application/Utilities/Console and
如果您没有运行 Xcode(我的是 4.5.2),而只是运行模拟器(我的是 6.0),那么当应用程序崩溃时,它会保存崩溃报告。要查看它,请打开应用程序/实用程序/控制台,然后
(1) make sure it shows the log list (see top left of console to make sure not hidden)
(1) 确保它显示日志列表(请参阅控制台左上角以确保未隐藏)
(2) under "DIAGNOSTIC AND USAGE INFORMATION" there is a "User Diagnostic Reports" that if you open up should have your crash reports
(2) 在“DIAGNOSTIC AND USAGE INFORMATION”下有一个“User Diagnostic Reports”,如果你打开应该有你的崩溃报告
(3) the area on the right of the console has the log
(3)控制台右侧区域有日志