http://www.bugsense.com/docs/ios
Using BugSense in your iOS application is super easy!
- Download the file, and unzip it.
- In Xcode, select the target that you want to use and, in the "Build Phases" tab expand the "Link Binary With Libraries" section. Press the "+" button, and then press "Add Other...". In the dialog box that appears, go to the framework's location and select it.
- The framework will appear at the top of the "Link Binary With Libraries" section and will also be added to your project files (left-hand pane).
- If your development stack is older than Xcode 4.2/iOS 5.0, BugSense may not work for you. We are working to improve compatibility with older development environments.
Configuring your project
BugSense depends on SystemConfiguration.framework
, and you have to add it to your project by selecting it from the list of frameworks in "Link Binary With Libraries". Then, in your target properties:
- change the value of "Strip Debug Symbols During Copy" and "Strip Linked Product" to No for all configurations (typically Debug and Release).
- Make sure that "Deployment Post Processing" is set to No for all configurations.
- Make sure that "Generate Debug Symbols" is similarly set to Yes.
Note: Your project should be working fine with those settings. However, if you find that reporting or symbolication is problematic, try this: * In your target's properties, * in "Other Linker Flags" add -ObjC * additionally, in "Other Linker Flags" add -all_load
Using BugSense
Add the following lines in the implementation file for your app delegate (something likeAppDelegate.m
), ideally at the top ofapplication:didFinishLaunchingWithOptions:
:
The first argument is the BugSense API key (NSString
). The second argument is anNSDictionary
where you can put any object/key pairs to send back with the crash report. The third argument is a switch (BOOL
) that can enable the dispatch of a crash report immediately after the crash has occurred, instead of on relaunch.
To see your crashes being reported, use your app on their own (on your device or on the simulator) and not through Xcode.
Exception logging
Logging exceptions is very simple: use the BUGSENSE_LOG macro to post the exception and its stacktrace along with a tag to identify it, e.g.: