Crash logs generated by iPhone Simulator?

IphoneIos SimulatorCrash Reports

Iphone Problem Overview


Are there any crash logs generated by iPhone Simulator?

the Simulator crashes a lot but not leaving any traces in Console... the crash log will be useful.

Iphone Solutions


Solution 1 - Iphone

The console will show the NSLog() output from an app running in the simulator. The crash logs are saved to file.

I have found some in my home directory under

~/Library/Logs/DiagnosticReports/

They have a file extension of .crash

Something I haven't yet figured out is how to get them to generate even if the debugger grabs the EXC_BAD_ACCESS signal.


Update

Currently, (OSX 10.11.6), the .crash logs in ~/Library/Logs/DiagnosticReports, are when the emulator itself crashes. Logs for an app crashing (but the emulator device is still running fine), are in:

>~/Library/Logs/CoreSimulator

Per crash, there is a sub-folder with a unique id. Sort by date, so that your recent crash is the first sub-folder. Inside that, start by looking at stderr.log and system.log.

Also directly under CoreSimulator, see CoreSimulator.log and Simulator.log.

Solution 2 - Iphone

I am pretty sure that you can see this in the OS X Console app located in Utilities. If I'm wrong though, be sure to vote me the heck down so I delete this.


UPDATE:

Specifically (as of OSX 10.11.6),

When an app crashes on emulator, a subfolder (with a unique id) is added to:

>~/Library/Logs/CoreSimulator

Within that, start by examining stderr.log and system.log.

When the emulator itself crashes, a subfolder is added to:

>~/Library/Logs/DiagnosticReports

Don't confuse this path with

> /Library/Logs

(lacking ~ at start), which has different reports about your mac.

Solution 3 - Iphone

Here’s something that worked for me in a special case... My app was crashing with SIGKILL as it terminated. I would see the exception in main.m for a few seconds, and then the app would finish terminating – thus, no chance to get the back trace.

I did a lot of searching on “where does simulator store its crash logs” and never managed to find an answer. However, the following trick came in quite handy and I was able to grab the crash log on the fly:

Basically, open /Applications/Utilities/CrashReporterPrefs.app and change the setting to “Developer”. This will cause CrashReporter to display a popup with the crash log after your app crashes.

I found this in the “Viewing iOS Simulator Console and Crash Logs” section in this doc from Apple: http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/ios_development_workflow/125-Using_iOS_Simulator/ios_simulator_application.html

Solution 4 - Iphone

The crash crash logs will appear under ~/Library/Logs/CrashReporter.

  • If the iPhone simulator program crashes (not the iPhone app running within the simulator), then there will be an entry for iPhoneSimulator.
  • If the iPhone App within the simulator crashes, the crash log will appear with the display name of the app.

When Xcode gets crash logs from a connected device, it stores them in sub-folders of ~/Library/Logs/CrashReporter/MobileDevice

Solution 5 - Iphone

This is much more reliable. In only a few steps I was able to find the source line number & method name:

  1. cd to the dir having the .app & .dSYM files
  2. run /Developer/Platforms/iPhoneOS.platform/Developer/usr/libexec/gdb/gdb-arm-apple-darwin MyApp.app/MyApp
  3. set print asm-demangle on
  4. set print symbol-filename on
  5. p/a 0×00015c64 -> address got by opening the crash log in “Console” app or just double clicking the the .crash file.

Solution 6 - Iphone

For me, it was an expression that I had added to the debugger watch window. When a breakpoint was getting hit, the bad expression was causing XCode to segfault.

Solution 7 - Iphone

You may also want to take a look at this related answer: https://stackoverflow.com/a/14984297/679240

None of the answers above worked on the "Big Sur" OS version. The only way to find the log was through the "Console" app (Application/Utilities/Console)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRaptorView Question on Stackoverflow
Solution 1 - IphoneohhorobView Answer on Stackoverflow
Solution 2 - IphonebpapaView Answer on Stackoverflow
Solution 3 - Iphonedana_aView Answer on Stackoverflow
Solution 4 - IphoneWalt SellersView Answer on Stackoverflow
Solution 5 - IphoneGamma-PointView Answer on Stackoverflow
Solution 6 - IphonepTymNView Answer on Stackoverflow
Solution 7 - IphoneHaroldo_OKView Answer on Stackoverflow