How to upload dSYMs from your Jenkins server to Raygun

| 2 min. (363 words)

If you develop native Objective-C iOS apps, then you’ll know that dSYM files are essential to debugging app crashes. This is why Raygun has first class support for using dSYM files that you upload to symbolicate your crash reports – so you can have nice readable stack traces to track down those bugs. You can upload dSYM files either through your Raygun.com account, or using the free Raygun Sidekick mac app. Sometimes however, these are not viable options – for example, you may want to automate the dSYM upload process from your build server. Fortunately we have an API for that which one of our customers – Sam McEwan from My Tours – utilized to upload dSYM files using Jenkins.

It’s quite simple really, create a post build task in Jenkins to zip up the generated dSYM file, and then send it to Raygun with something like this simple cURL script:

curl -L -F "DsymFile=@build/<APP_NAME>-<BUILD_NUMBER>-dSYM.zip" https://app.raygun.com/dashboard/<APP_ID>/settings/symbols?authToken=<EXTERNAL_ACCESS_TOKEN>

The APP_NAME and BUILD_NUMBER here make up the name of the zipped dSYM. The APP_ID is created by Raygun which you can find in the url of your application dashboard on Raygun.com. You may even wrap this all up into a custom Jenkins plugin so that you can more easily reuse it.

To obtain the EXTERNAL_ACCESS_TOKEN from Raygun, follow these steps: click your name in the top right corner, choose “My settings,” and then either generate a new external access token or copy the existing one if available.

API details

If you want to upload dSYM files in other systems, here are details about the API. You’ll want to POST dSYM files to the following address:

https://app.raygun.com/dashboard/{app_id}/settings/symbols

Where app_id is the id of your application in Raygun. The content type is multipart form-data which is expecting an item called DsymFile which of course is the zipped dSYM. You’ll also need to use basic auth with your Raygun credentials.

We love hearing about all the different ways our customers are using Raygun, so if you have any interesting stories, let us know in the comments!

Interested in using Raygun to track all your software exceptions? Sign up for a 14 day free trial now. No credit card required.