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 4 of 6 of this article. Click here to view the first page.

Bugsense — Summing it Up

This ends the how-to portion of Bugsense. The platform is quite feature-rich and supports Windows8, Windows Phone and HTML5.

A desktop application to automate the upload of dSYMs would definitely be appreciated, as well as the automatic symbolication of crash logs when they are received on the server.

TestFlight was born as a tool to manage the distribution of beta releases. Over time the developers added many more features, like action logging and crash reporting.

TestFlight has been adopted by companies such as Adobe, Instagram and tumblr to manage over-the-air deployment, tracking and crash reporting. iOS is the only platform supported at the moment.

TestFlight — Configuring the Project

As mentioned in the previous part of this article, TestFlight is a bit more than a crash reporting system, for it also allows you to recruit testers and distribute your test builds. Once you have logged in, head to the SDK download page to download the SDK. The current version at the time of this writing is 1.2.4.

Open a new copy of the starter project, unzip the TestFlight SDK, drag the entire folder onto the root of the project, and make sure “Copy items into destination folder (if needed)” is checked.

In the target settings, select the Build Phases tab and then open the Link Binary With Libraries section. libTestFlight.a should appear in the list of linked libraries. Also click the “+” button and add the libz.dylib as shown below:

Framework linking in TestFlight

Select the Build Settings tab and select “NO” for the following flags:

  • Deployment Postprocessing
  • Strip Debug Symbols During Copy
  • Strip Linked Product

Compile the application using Cmd+B to check if everything is ok. Next you’ll need a particular token to make your app work with TestFlight. To get this token, go to your TestFlight team dashboard and copy the team token displayed. That’s the key you’ll need to initialize the framework in the code.

Open SMAppDelegate.m and add the following import:

#import "TestFlight.h"

Insert the following code at the beginning of application:didFinishLaunchingWithOptions: in SMAppDelegate.m:

[TestFlight takeOff:@"YOUR TOKEN HERE"]; ///< Replacing "YOUR TOKEN HERE" with the token you found on your team dashboard

Now you're ready to test the application against the first bug. I suggest you download and install the companion desktop application before doing this, which you can download from here. This app is smart enough to detect when you have archived an application and offers to upload both the .ipa file and the dSYM. This will save you some pointing and clicking on the TestFlight website.

If you've never set up a binary for adhoc distribution, TestFlight has provided some detailed instructions to get you started.

If you use the desktop application (which I highly suggest you do!), follow the wizard's instructions and at the end you'll be prompted to copy out the share URL. That's the URL of the new build you've just submitted — you can send this link to your testers.

To install the app to your device, simply open that URL on your device. It's that easy! :]. Run the app, crash it by swiping and hitting "Delete", and restart the app. Now check to see if your crash report shows up on the web back-end by heading to the TestFlight dashboard. If all went as expected, you should see something similar to the following:

A build on TestFlight

Note: Crash logs sometimes take a while before showing up on the web interface. TestFlight support indicated that these issues will be resolved in the next release of the SDK.

This view already provides some interesting data about your build - the number of crashes, feedback and total installations. In your case, you should see one install and one crash. Click the Latest build link to get the detailed report, as shown below:

Activity view on TestFlight

A menu on the left gives you an overview of the data related to the build, such as the number of session and the total number of crashes. In the middle section you can see the list of users and on the far right, a summary of the recent activity performed on the application by users.

Tap on the Crashes tab on the left and expand the log using the little arrow on the right. You'll see the complete stack trace, as below:

A detailed crash log on TestFlight

Another interesting feature in TestFlight is the ability to add checkpoints. Checkpoints are much like breadcrumbs or events - you spread some log statements in key places in your code to get a better idea of what happened before a crash.

To place a checkpoint in your code, use the method passCheckpoint.

Open SMViewController.m, import the TestFlight framework:

#import "TestFlight.h"

Now insert the following code at the end of viewDidLoad:

[TestFlight passCheckpoint:[NSString stringWithFormat:@"view loaded with %i pizzas", pizzaOrder.count]];

Create a new build and distribute it. Install it on your device, run it, scroll down the table view to make it crash, and restart the app to allow the sending of logs to the server. Now open the dashboard, select the new build and click the Checkpoints tab on the left to see the list of checkpoints. You'll see something similar to the screenshot below:

Checkpoint on TestFlight

If you click the Crashes tab, the second bug report will appear:

The second bug on TestFlight

TestFlight offers a feature which is especially nice during beta testing - collecting feedback from your users directly in your app! Open SMViewController.m, and the following import statement to the top of the file:

#import "TestFlight.h"

Now modify tableView:commitEditingStyle:forRowAtIndexPath: as follows:

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{

    [TestFlight openFeedbackView];
    
}

Create a new build and upload it. Open the app, swipe, and tap to delete. Once the delete button is tapped, a view controller like the following will appear:

Feedback view on TestFlight

From here the user can send you direct feedback about the current build. You can see the messages sent by users in the “Feedback” section of your build, as so:

Feedback on TestFlight

TestFlight — Summing it Up

TestFlight is a complete service that covers distribution, crash reporting and remote logging. However, I have noticed that sometimes the dSYM is not uploaded successfully by the desktop application and you'll have to re-upload it using the website.

HockeyApp is pretty well known in the indie developer world — probably because it’s made by indie developers! :]

HockeyApp supports iOS, Android, MacOS, and Windows Phone. HockeyApp, like TestFlight, is more than a crash reporting tool. It also allows you to manage the distribution of builds to beta testers, as well as providing a platform to collect feedback.

Contributors

Over 300 content creators. Join our team.