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.
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress, bookmark, personalise your learner profile and more!
Create accountAlready a member of Kodeco? Sign in
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress, bookmark, personalise your learner profile and more!
Create accountAlready a member of Kodeco? Sign in
Contents
Overview of iOS Crash Reporting Tools: Part 2/2
50 mins
- Getting Started
- Crashlytics — Configuring the Project
- Crashlytics — Running the App
- Crashlytics — Summing It Up
- Crittercism — Configuring the Project
- Crittercism — Uploading the dSYM
- Crittercism — Running the App
- Crittercism — Summing it Up
- Okay Class — Time for a Break!
- Bugsense — Configuring the Project
- Bugsense — Running the App
- Bugsense — Summing it Up
- TestFlight — Configuring the Project
- TestFlight — Summing it Up
- HockeyApp — Configuring the Project
- HockeyApp — Summing it Up
- Conclusion
Crashlytics — Summing It Up
This concludes the guided tour of Crashlytics. If you are just targeting the iOS market, I highly recommend that you consider Crashlytics. The service is very quick to upload crashes, there are no hassles with dSYM files, and the back-end service is quite intuitive.
Crittercism is another full-stack tool to keep track of your crash logs. It has been adopted by companies such as Netflix, Eventbrite and Linkedin. It provides support iOS, as well as Android, HTML5 and Windows 8 (which is in beta at the moment).
Crittercism — Configuring the Project
To get started with Crittercism, there are a few steps to follow:
- Register an application.
- Download and import the SDK.
- Configure the Xcode project.
After you login to Crittercism, assuming it’s your first time, you will end up at the following screen:
Tap the big blue button on the top left. You’ll be presented with the following screen:
This will ask you to assign a name; for this project, put “crashy”. Then select the iOS platform, and don’t bother to invite any collaborators. You’re just testing the application, so choose No for the question “In App Store?”. When you’re done, click the big blue Register App button at the bottom.
Next you will be prompted to download the most recent version of the SDK (which is 3.5.1 at the time of this writing). Here’s the link to the download page, just in case.
Open a new, unfixed copy of the crashy-starter project in Xcode, unzip the Crittercism SDK, drag and drop the folder named CrittercismSDK onto the root of our project, and make sure “Copy items into destination group’s folder” is checked.
Go to the Build Phases tab of the target. Open the Link Binary with Libraries section by clicking on it. You’ll notice that libCrittercism
is already linked. Add the SystemConfiguration framework and QuartzCore by clicking on the plus sign, as shown below:
Next, you need to find the App ID. This is the ID for Crittercism and has nothing to do with Apple’s application ID. Head to the Crittercism dashboard, select your application from the list, and click the settings tab on the left. You will see a section that looks like this:
This provides a portion of code to copy and paste into application:didFinishLaunchingWithOptions:
of SMAppDelegate.m. First, add the following import statement at the top of SMAppDelegate.m:
#import "Crittercism.h"
Now add the Crittercism supplied code to the top of application:didFinishLaunchingWithOptions:
:
[Crittercism enableWithAppID:@"<YOUR_CRITTERCISM_APP_ID>"];
And that’s it, your project is configured to work with Crittercism!
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:
Note: If you are still having problems uploading your dSYM file, check out this YouTube video that screencasts the process, step by step.
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:
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:
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:
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:
You can now mark the issue as resolved using the drop down menu on the left side of the graph as shown below:
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.