Posted by & filed under Blog, Tech.

When iPhone or iPad apps crash, you typically see crash information such as

Thread 5 name:  Dispatch queue: com.apple.root.default-priority
Thread 5 Crashed:
0   libobjc.A.dylib               	0x333a6c98 objc_msgSend + 16
1   rogerthat                     	0x00028066 0x1000 + 159846
2   rogerthat                     	0x00056876 0x1000 + 350326
3   rogerthat                     	0x0006eaa2 0x1000 + 449186
4   rogerthat                     	0x000c8224 0x1000 + 815652
5   rogerthat                     	0x0002b69a 0x1000 + 173722
6   rogerthat                     	0x0002c052 0x1000 + 176210
7   rogerthat                     	0x0002b336 0x1000 + 172854
8   rogerthat                     	0x00025de8 0x1000 + 151016
...

This crash information can be found in XCode – Organizer – Device Logs.
These crash reports are pretty unusable unless you “symbolicate” them.

Here is a small tutorial on how to do this:

  • Build your iPhone app using Build and Archive in the XCode Build menu
  • In XCode Organizer, select your app in Archived Applications
  • Select the appropriate build and right click Show in Finder
  • Apple-C to copy this folder
  • In your terminal cd to that folder (Apple-V to paste)
  • locate symbolicatecrash – On my Mac it is in
    /Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash
  • Execute the symbolicatecrash command and enjoy a readable crash report
$pwd
/Users/carl/Library/Application Support/Developer/Shared/Archived Applications/97868891-2237-46CA-A87E-66E6E7B7A2DF.apparchive

$ls
ArchiveInfo.plist	rogerthat.app		rogerthat.app.dSYM

$locate symbolicatecrash
/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/ DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash

$/Developer/Platforms/iPhoneOS.platform/Developer/Library/ PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/ symbolicatecrash ~/Downloads/stack.txt

...

Thread 5 name:  Dispatch queue: com.apple.root.default-priority
Thread 5 Crashed:
0   libobjc.A.dylib   0x333a6c98
                      objc_msgSend + 16

1   rogerthat     0x00028066
                  -[NSMutableDictionary(MCTTools2) setString:forKey:]
                  (MCTJSONUtils.m:168)

2   rogerthat     0x00056876
                  -[MCTIntent setString:forKey:]
                  (MCTIntent.m:123)

3   rogerthat     0x0006eaa2
                  -[MCTIdentityStore saveAvatarWithData:]
                  (MCTIdentityStore.m:219)

4   rogerthat     0x000c8224
                  -[MCTGetAvatarResponseHandler handleResult:]
                  (MCTGetAvatarResponseHandler.m:66)

5   rogerthat     0x0002b69a
                  -[MCTRPCProtocol processIncomingResponse:]
                  (MCTRPCProtocol.m:201)

6   rogerthat     0x0002c052
                  -[MCTRPCProtocol processIncomingMessagesDict:]
                  (MCTRPCProtocol.m:260)

7   rogerthat     0x0002b336
                  -[MCTRPCProtocol processIncomingMessagesStr:]
                  (MCTRPCProtocol.m:321)

8   rogerthat     0x00025de8
                  -[MCTCommunicationManager communicationFinishedWithLoop:]
                  (MCTCommunicationManager.m:368)

...

Leave a Reply