Overview of iOS Crash Reporting Tools: Part 2/2

In this second part of a series on iOS Crash Reporting Tools, you’ll learn how to get started with 5 of the most popular services: Crashlytics, Crittercism, Bugsense, TestFlight and HockeyApp. By Cesare Rocchi.

Leave a rating/review
Save for later
Share

Learn how to integrate your choice of iOS crash reporting tool

Learn how to integrate your choice of iOS crash reporting tool

Thanks for joining me for the second part of this two-part series on crash reporting services!

The first part introduced you to the architecture of crash reporting services, including storage, symbolication, and server-side management. As well, I provided a basic overview and comparison chart of the most popular crash reporting services today.

In this second part, I’ll take you through the steps to get started with each service covered in the last article: Crashlytics, Crittercism, Bugsense, TestFlight and HockeyApp.

Throughout this article, you will work with a very simple iPhone application that just contains a table view, as shown in the screenshot below:

The sample App for this Tutorial

This particular app has been constructed to generate crash events. That’s bad news in the real word — but for our purposes, it will serve perfectly!

Getting Started

The app provides a pizza menu with two functions:

  1. Swipe to delete a pizza from the menu.
  2. Scroll to the bottom to load more pizzas.

The code for our pizza application can be found here.

Download the project, then build and run in the simulator. To cause a crash, swipe to delete a row, or simply scroll to the bottom of the list.

Note: The sample app is designed to run on iOS6 and above. If you are testing on an pre iOS6 device, you will need to disable AutoLayout.

To do so, open SMViewController.xib, select the File Inspector, then uncheck “Use AutoLayout”, as shown below:

Disable AutoLayout

Now when your app crashes, you’ll really mean for it to happen! :]

Although I know it’s killing you not to fix the bugs, don’t! You want the application to crash so that a reporting tool can help you to identify the source of the problem.

Here are a list of the crash reporting services that I’ll cover in this article:

Keep in mind that there is a waiting period for Crashlytics where it may take several days for Crashlytics to contact you. However, if it does take a long time then no fear because Crashlytics has generously provided RayWenderlich.com with a special link that will help you jump the queue. Try that and see if you get in the VIP door a little faster! :]

Before continuing, make sure you create an account with each of the crash reporting frameworks and download each of the crash reporting SDKs.

Since some crash reporting tools require a unique identifier to function correctly, make sure to change the sample project’s bundle identifier to something of your own design, as shown below:

Change bundle identifier

Once you have a set a custom bundle identifier, make sure to make a backup copy of the project. Each framework has their own installation instructions so it is best to use a “vanilla” project with each demo.

In order to test out these crash reporting frameworks, you will need to run the app on a real device. This requires an Apple developer account as well as a provisioned device. If you are a new to iOS development, you can learn how to create a developer account, as well as provisioning your own device in this tutorial.

Note: During this tutorial, do not run the application on the device through Xcode. Xcode will intercept the crash, then open the lldb debugger shell as usual. You won’t get any crash reports if Xcode intercepts the crash event!

To make all the examples below work, you have to build and run the application, then click the stop button on Xcode. This way you will have the latest version installed on the the device.

Once that is done, you can launch the app on the device itself, and then crash it all you want!

All the crashes on your iOS device will be caught and sent to the server component of the service that you have integrated into the app. Crash reports are usually sent to the server the next time you start the app, so the steps to follow to generate a crash report on the server are as follows:

  1. Build and run on Xcode.
  2. Press the stop button.
  3. Run the app on your iOS device.
  4. Make the app crash.
  5. Run the app again.

As well, make sure the device has connectivity via wi-fi or 3G so that the crash reports can be sent. Now, let’s get crashing! :]

Recently bought by Twitter, Crashlytics is pretty famous in the iOS community. It’s used by well-known companies such as Path and Yammer. It is a full-stack service, meaning that the framework provides both client-side and server-side parts.

At the moment, Crashlytics supports only iOS, although the website does indicate that Android support is coming soon.

Crashlytics — Configuring the Project

Once you have logged into Crashlytics, you will be prompted to download a Mac OSX application that will help you to set up your first project.

To save you time, here’s the direct link to the Mac application. When running, the application appears in the menu bar on the top right as shown below:

Crashlytics in the menu bar

Click on the icon and enter your credentials when prompted. If this is your first time using Crashlytics, you should see an empty list of applications and your account name at the bottom, as shown below:

Crashlytics after login

Click on the New App button on the right. This will show you the list of recent projects opened in Xcode, like so:

Recent Projects in Crashlytics

If your app is not listed, you’ll need to perform the following steps:

  1. Click the “Other” button at the bottom to open a Finder window.
  2. Select the .xcodeproj file and click “Open”.
  3. Select your project from the list in Crashlytics and hit “Next”.

This will automatically open the project in Xcode and ask you to add a script to the Build Phase. From this point onward, the Crashlytics app will walk you through each step of installation process. Follow the instructions, and when you’re done, continue with the next step of the tutorial.

Contributors

Over 300 content creators. Join our team.