How to symbolicate iOS crash dumps from Unity Cloud Build games

Disclaimer: this advice is provided without warranty, works on my machine, etc. Use it at your own risk.

We’ve been using Unity Cloud Build at Spry Fox for a soon-to-be-announced project. Since we’re a remote company, it’s great to be able to push and know that both Android and iOS builds will be soon available to everyone in the team with your new feature. It’s saving a lot of time every day.

This morning I pushed our new IAP back-end, which of course involved some low-level stuff on both platforms. Everything worked on local builds, but when I tried the iOS build from Unity Cloud, it crashed on start-up. Getting the callstack of the crash turned into a bit of an odyssey. I thought I’d document it here.

By default, Unity will not generate Xcode projects that produce useful debug info. We can fix this by adjusting the Xcode project after generation, but that’s no good for Unity Cloud Build where we have no control.

So, one time only, you should add this file https://gist.github.com/tenpn/f8da1b7df7352a1d50ff to your project (EDIT: in an editor subfolder; thanks Terry Paton). That will do the post-processing for you and for Unity Cloud Build. (There are conflicting reports as to if this increases build size, but you definitely want it while developing. It might still be worthwhile leaving it in for release, because it will be extremely helpful in chasing down crashes in the wild.)

Wait for Unity Cloud Build to produce a new build containing that change, install it, and repro the crash on your device. Then follow these steps:

  1. Go to the cloud build project for your game, and find the dSYM and ipa downloads for the build you installed. At the moment, you click Install on the build in the history list, then Share, then both Download to Desktop for the ipa and Download dSYM.
  2. Unzip the dSYM somewhere safe. I put it in a new folder named after the Cloud build number we are investigating. The location should be somewhere Spotlight can index.
  3. Rename the ipa extension to zip, and unzip the .app inside to the same folder as the dSYM.
  4. Attach your iOS device via USB to your OSX machine
  5. In Xcode (these steps are for Xcode 6.1.1), go to Windows->Devices
  6. Select your device in the left pane, and click View Device Logs
  7. There should be a crash dump for your game. Locate it by the process name and crash time columns and click on it.
  8. The right window should now have the crash dump with a named callstack. If not, right-click on the crash dump in the left pane and select Re-Symbolicate Log.

Hopefully this gets you enough info to start debugging your app.

Shameless plug: DecisionFlex is a new unity plugin to let your AI make human-like and emergent decisions.

Advertisements

3 thoughts on “How to symbolicate iOS crash dumps from Unity Cloud Build games

    • We started using it on a really young project, so didnt have any issues to start with.

      We are currently having issues after adding an iOS plugin, because a python script couldnt add an -ObjC flag to the Xcode project. Seems it’s best to add that from a c# script, not python, but I haven’t tried the fix yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s