Crash logs generated by iPhone Simulator?

前端 未结 7 1921
野性不改
野性不改 2020-12-22 21:49

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.

相关标签:
7条回答
  • 2020-12-22 21:56

    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.
    0 讨论(0)
  • 2020-12-22 22:03

    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.

    0 讨论(0)
  • 2020-12-22 22:06

    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

    0 讨论(0)
  • 2020-12-22 22:09

    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)

    0 讨论(0)
  • 2020-12-22 22:12

    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.

    0 讨论(0)
  • 2020-12-22 22:15

    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.

    0 讨论(0)
提交回复
热议问题