Last night my iPhone game crashed while running in debug mode on my iPhone. I just plugged it into my Mac, and was able to find the ips
file. The stack trace shows the function in my app where it crashed, and then a couple of frames in libswiftCore.dylib
before an assertion failure.
My question is - I've got absolutely no idea what the assertion failure actually was, all I have is...
0 libswiftCore.dylib 0x1921412a0 closure #1 in closure #1 in closure #1 in _assertionFailure(_:_:file:line:flags:) + 228
1 libswiftCore.dylib 0x192141178 closure #1 in closure #1 in _assertionFailure(_:_:file:line:flags:) + 327
2 libswiftCore.dylib 0x192140b4c _assertionFailure(_:_:file:line:flags:) + 183
3 MyGame.debug.dylib 0x104e52818 SentryBrain.takeTurn(actor:) + 1240
...
How do I figure out what the assertion failure was that triggered the crash? How do I figure out what line of code in takeTurn(...)
triggered the failing assertion failure?
_assertionFailure()
usually puts its error message, which includes a filename and line number, in the "Application Specific Information" section near the top of the crash log. You might want to check for information there.
Another thing that might help is to open the crash log with Xcode. If the debug info for that build of your game is available, the backtrace in the Debug Navigator may point to the specific line of the code that crashed.
If neither of those ideas helps, your best bet might be to run your game from Xcode and try to reproduce the crash while the debugger is attached.