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
You are currently viewing page 3 of 6 of this article. Click here to view the first page.

Crittercism — Uploading the dSYM

Unlike Crashlytics, you have to manually upload your dSYM file to the server. To find the dSYM file, follow the instructions in the first part of the tutorial in the Symbolication section.

Recall from the first part of this tutorial that a dSYM is actually a directory. For this reason, you’ll need to zip your dSYM folder first before uploading it to Crittercism. To upload your zipped dSYM file use the tab Upload dSYMs in the “Settings” section of your app, as shown below:

Upload dSYM on Crittercism

Note: If you are still having problems uploading your dSYM file, check out this YouTube video that screencasts the process, step by step.

Once you have uploaded the dSYM folder, run your application, either on your simulator or on your device, and the console should print the following message:

Crittercism successfully initialized.

Let’s start by tracking down the first bug.

Crittercism — Running the App

As you did before, run the application without Xcode, attempt to delete a cell, and restart the application. Now visit the Crash Reports section of your application on the back-end. You should see your crash report as shown below:

Dashboard on Crittercism

The dashboard will show an overview of your application with a big graph at the top and the list of issues at the bottom. Just pretend you don’t know the what the source of the bug is, and click the issue in the list to inspect it. You’ll see a detailed report similar to the following:

A crash report on Crittercism

The “Reason” column should lead you to think there is an issue with the table view. You might see more details, but the log is not yet symbolicated, so you don’t know which file and line of code is responsible for the crash.

You’ll need to add the log to a queue to be symbolicated, by clicking the Add to Symbolication Queue link highlighted in the screenshot above. Once it has been symbolicated, you will see the decoded thread of the crash, which indicated an issue on line 80 in file SMViewController.m, as shown below:

Decoded log on Crittercism

One shortcoming of Crittercism is that I couldn’t find a way to queue crash logs automatically as they get uploaded. If you’ve found a way around this, please let me know in the comments!

If you select the “Users” tab, you’ll notice that Crittercism automatically generates IDs to identify users, as shown in the following screenshot:

User ids on Crittercism

You can now mark the issue as resolved using the drop down menu on the left side of the graph as shown below:

Resolve Crittercism Bug

If you’d like to collect more specific data about users, the Crittercism class also provides the following methods:

[Crittercism setUsername:(NSString *)username];

[Crittercism setEmail:(NSString *)email];

[Crittercism setGender:(NSString *)gender];

[Crittercism setAge:(int)age];

[Crittercism setValue:(NSString *)value forKey:(NSString *)key];

An interesting feature is the ability to log handled exceptions on the server as follows:

@try {
        [NSException raise:NSInvalidArgumentException
                    format:@"Argument must be a string"];
        } @catch (NSException *exc) {
            [Crittercism logHandledException:exc]
        }

Crittercism also offers breadcrumb logging for enterprise accounts and an assortment of other features.

Crittercism — Summing it Up

This concludes the how-to portion on Crittercism. The Crittercism framework also supports Android, Windows 8 and HTML5.

I’ve found that the user interface for the back-end is a bit complex, requiring a few extra clicks to get to the required information. It’s a bit clumsy to manually upload the dSYM for each build, but overall, it’s a solid framework.

Okay Class — Time for a Break!

Okay, it’s time for a short break from your crash reporting studies. Answer the following tricky question.

[spoiler title=”Is divide-by-zero an operation that causes a crash on ARM?”]No! Weird, huh? :] Well, it actually depends on the implementation of the ARM ABI (Application Binary Interface). But iOS devices won’t crash just because you divide by zero because of the way the ABI has been implemented.[/spoiler]

Bugsense is another full-stack service, used by big companies such as Samsung, Intel and Groupon. It supports iOS, Android, Windows 8, Windows Phone and HTML5.

Bugsense — Configuring the Project

Once you are logged in to Bugsense, you will end up in the dashboard which should be empty if this is your first time using Bugsense. Click the “Add New Project” button, enter a name for your project, select iOS for Technology, Testing for the stage, then click Submit, as shown below:

Creating an Application on Bugsense

The website will then show a dashboard with no data, since you have not yet integrated the framework. When you first visit your project page, a welcoming lightbox will greet you which will contain your API key, as so:

Bugsense API Key

Copy down this key as you’ll be needing it later!

Unfortunately there is no direct link to download the SDK, so you will have to click the Docs item in the top right bar of the dashboard. This will open the generic documentation page, from which you have to select iOS. You will end up at this link. This page should contain a URL to download the iOS SDK (which is version 3.2 at the time of this writing).

Unzip the downloaded ZIP file and it will create a folder named BugSense-iOS.framework. Next, open a new copy of the starter project and go to the Build Phases tab. As previously, expand Link Binary With Libraries, click the + button, choose Add other, and select the unzipped BugSense-iOS.framework folder. Also add SystemConfiguration and libz.dylib. The link section should now look like the following:

Framework linking on bugsense

Switch to the Build Settings tab and make sure that “Strip Debug Symbols During Copy” and “Strip Linked Product” are both set to YES as shown here:

More project settings on bugsense

Now you just need to insert a few hooks to integrate your app with Bugsense. Insert the following statement at the top of SMAppDelegate.h:

#import <BugSense-iOS/BugSenseController.h>

Next, open SMAppDelegate.m and add the following code to the beginning of application:didFinishLaunchingWithOptions:, using the API key you copied down earlier:

[BugSenseController sharedControllerWithBugSenseAPIKey:@"YOUR API KEY"];

Now you’re ready to test Bugsense with your first bug!

Bugsense — Running the App

Just like in the previous sections, build and archive your project, install the application (.ipa file) on the device, and zip the dSYM file for later upload. Once the application is installed, run it, make it crash by deleting a row, and restart the app. Head over to the dashboard of Bugsense and open your project. You’ll see the following report:

Bugsense User Interface

A nice graph shows the number of crashes per day. Underneath is the list of error logs — just one in this case. You can immediately see the generic reason behind this issue; click the issue to open the detailed report as shown below:

Symbolicate

The stack trace as shown is complete, but has not yet been symbolicated. Click the Symbolicate link on the top right. In this case, it will fail to symbolicate the trace because the dSYM is not yet on the server, and the button will turn green with a label of “Upload Symbols”.

Click the Upload Symbols button, and you will be redirected to the settings section of the application, where you can upload your zipped dSYM folder, as shown below:

Upload dSYM Files

Once you have uploaded your dSYM files, head back to the detailed view of the error log and again click the Symbolicate link. This time you will see that line 7 is decoded, clearly showing the line responsible for the crash:

Symbolicated crash on bugsense

Below the crash log, there is also a handy table showing lots of details about the crash. This table can be customized using the gear icon on the right to show many more pieces of data like locale, milliseconds elapsed from the start of the application, data about the mobile carrier and WiFi status, as shown below:

Report details on bugsense

Personally, I am a bit concerned about the UDID, which has been deprecated since iOS5.

To mark a crash as resolved, return to the application dashboard, select the crash in question, then press the button labeled Resolve Selected, as below:

Resolve Open Bug

You can also provide the number of the release that includes the fix by clicking the Settings link in the navigation bar then selecting Fix Notifications. You can even personalize the message to be sent via push notification like so:

Setting notifications on bugsense

Bugsense also supports breadcrumbs, but they are only accessible in higher paid plans.

Contributors

Over 300 content creators. Join our team.