Monday, January 9, 2012

Today's word: Symbolication

When developing applications for iOS, it is important to keep a copy of the debug symbols for builds delivered to testers and for builds submitted to the App Store. Without these files, it is not possible to "symbolicate" crash reports from users. Unfortunately all of the documentation on symbolicating crash reports seems to assume a single developer model. The documentation talks about the build archiving functionality built in to Xcode. If you archive your builds within Xcode, you'll be able to symbolicate crash reports from users running that build.

In a team environment, it is a bit more complicated. Since documentation from Apple and elsewhere on Internet is lacking in this area, I felt it might be useful to share what I've figured out.

For my project we have a build server that performs nightly builds of the project, as well as builds on demand. In order to symbolicate crash reports, developers need to copy the build artifacts (the application and associated debug symbols) from the build server to their workstations. I doesn't matter where you save the files on your workstation as long as Spotlight can index them.

Our automated build produces a .zip file containing something like this:
  ios/cmMobile_src.zip
ios/debug/cmMobile.app.dSYM/Contents/Info.plist
ios/debug/cmMobile.app.dSYM/Contents/Resources/DWARF/cmMobile
ios/debug/cmMobile.ipa
ios/distribution/cmMobile.app.dSYM/Contents/Info.plist
ios/distribution/cmMobile.app.dSYM/Contents/Resources/DWARF/cmMobile
ios/distribution/cmMobile.ipa
ios/release/cmMobile.app.dSYM/Contents/Info.plist
ios/release/cmMobile.app.dSYM/Contents/Resources/DWARF/cmMobile
ios/release/cmMobile.ipa

Once this .zip file is uncompressed, the .ipa file must also be uncompressed. Despite the .ipa suffix, these files are just .zip files with a top-level folder called "Payload" which contains all of the files for the application. After the .zip and .ipa files are uncompressed, you can speed Spotlight along by typing 'mdimport .' in a parent folder.

That's all there is to it. Once you've done that you should be able to symbolicate crash reports from users running the corresponding build.

1 comment:

  1. Thanks to your great post, I have finally been able to symbolicate crash reports from versions built by our build server!

    It's a shame that official documentation about symbolication is around a single developer model.

    ReplyDelete