iOS Simulator Crash Logs

梦想与她 提交于 2019-12-03 17:07:30

问题


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.


回答1:


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)




回答2:


  1. Run your App with Xcode to install the App to iOS Simulator
  2. Launch your App on Simulator without Xcode
  3. reproduce steps for crash
  4. the Crash log should show up under this directory

    ~/Library/Logs/DiagnosticReports/




回答3:


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

(1) make sure it shows the log list (see top left of console to make sure not hidden)

(2) under "DIAGNOSTIC AND USAGE INFORMATION" there is a "User Diagnostic Reports" that if you open up should have your crash reports

(3) the area on the right of the console has the log



来源:https://stackoverflow.com/questions/11227519/ios-simulator-crash-logs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!