This is pretty basic, but I didn’t find this info all in one place, so I figured I’d post it here.
If your iPhone app is crashing, here’s a series of steps you can take to troubleshoot it:
- Check your build warnings. Just because there were no errors that prevented execution, doesn’t mean your app won’t crash. One common warning I often have to fix is mistyped method names. Objective-C will compile your code if you call methods on an object that don’t exist, but it will throw an exception at runtime.
- Check your Xcode console. Most crashes will show up here.
- Check your Mac OS X console. This is found under Applications/Utilities/Console. Sometimes a crash won’t output data in the Xcode console for some reason, but it will output it here.
- Check your Diagnostic Reports folder. This is found under /Users/youruser/Library/Logs/DiagnosticReports. When your app crashes in the simulator, it should create a new crash file here. Double-clicking one will open it in the Console app, and it should have info on what line number the crash happened on.
- Check your CrashReporter folder. This is for if crashes happen on your device when it’s not hooked up to the debugger. The next time you sync, the crash logs will be copied to /Users/youruser/Library/Logs/CrashReporter/MobileDevice/Your Device Name. You don’t want to bother opening these directly in the console, though–it doesn’t include method names and line numbers. Instead, you want to use a command-line utility called
symbolicatecrashto translate the crash log into a version with method names and line numbers. Konstantin Anoshkin’s blog describes the process well–the only change I had to make was that in Xcode 3.2 I now find symbolicatecrash at