Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Send iOS crash reports by email

branch: master

Revert "Change licensing header for files"

This reverts commit 83f6050.
latest commit 58323baac6
Steve Streza authored March 17, 2011
Octocat-spinner-32 CrashReporter Revert "Change licensing header for files" March 17, 2011
Octocat-spinner-32 .gitignore first commit January 20, 2011
Octocat-spinner-32 License.txt first commit January 20, 2011
Octocat-spinner-32 README.mdown change to readme January 20, 2011
Octocat-spinner-32 symbolicatecrash first commit January 20, 2011
README.mdown

CrashReporter

This repository is intended to help iOS developers easily put crash report emailing in their application.

Setup Your Application To Send Crash Reports

Put this code in your application delegate:

- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    ...

    if([MFMailComposeViewController canSendMail] && [[CrashReportSender sharedCrashReportSender] hasPendingCrashReport]){

        NSString *crashReport = [[CrashReportSender sharedCrashReportSender] getLastCrashReport];
        MFMailComposeViewController *vc = [[MFMailComposeViewController alloc] init];
        [vc setToRecipients:[NSArray arrayWithObject:@"YOUR_EMAIL@HERE.COM"]];
        [vc setSubject:@"App Crash"];
        vc.mailComposeDelegate = self;
        NSData *data = [crashReport dataUsingEncoding:NSUTF8StringEncoding];

        NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
        [formatter setDateStyle:NSDateFormatterShortStyle];
        [formatter setTimeStyle:NSDateFormatterNoStyle];
        NSString *date = [formatter stringFromDate:[NSDate date]];
        [formatter release];

        [vc addAttachmentData:data  mimeType:@"text/xml" fileName:[NSString stringWithFormat:@"%@.crash",date]];
        [navigationController presentModalViewController:vc animated:YES];
        [vc release];
    }

}
- (void) mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error{
    [navigationController dismissModalViewControllerAnimated:YES];
}

Making sense of crash report

Once you get the crash report, use symbolicatecrash to symbolize the crash report to make sense out of the file. ./symbolicatecrash "Report.crash"

Links

Something went wrong with that request. Please try again.