Crash reporting for Cocoa apps
You need to do a minimum configuration to get started with Apptics crashes. Before you begin, make sure that your app is already registered and configured in Zoho Apptics.
- If not, then create a project and add your app in Apptics and get the API token for your app.
Installation (available by default)
To integrate the Apptics CrashKit into your project, add the below dependency using CocoaPods.
Copiedsource 'https://github.com/CocoaPods/Specs.git'
target '[TARGET NAME]' do
pod 'AppticsCrashKit'
end
Automatic crash tracking
Crashes are automatically tracked in Apptics upon initialization for the Analytics module. Use enableAutomaticCrashTracking property in the AppticsConfig class to turn off automatic crash tracking, since it is enabled by default.
CopiedAppticsConfig.defaultConfig.enableAutomaticCrashTracking = false;
CopiedAppticsConfig.defaultConfig().enableAutomaticCrashTracking = false;
Custom Properties
Custom properties allow you to get the specific state of your app that led to a crash. This helps diagnose issues.
- To add custom properties in the crashes, call setCrashCustomProperty method with an NSDictionary object.
Copied- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary<UIApplicationLaunchOptionsKey,id> *)launchOptions {
[Apptics initializeWithVerbose:<#(BOOL)#>];
[Apptics setCrashCustomProperty:<#(nonnull NSDictionary *)#>];
return YES;
}
Copiedfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
Apptics.initialize(withVerbose: <#Bool#>)
Apptics.setCrashCustomProperty(<#NSDictionary#>)
return true
}
Symbolication settings
To symbolicate the crashes, ensure your build settings are set to the following configurations.
- Strip build symbols during copy - NO
- Strip linked product - NO
- Strip style - Debugging symbols
- Debug information format - DWARF with dSYM file
Upload dSYM
- Apptics script will automatically upload the dSYM files to the web console.
- You can verify whether the dSYM files are uploaded to the web console under Quality > dSYM.
- If the dSYM file is unavailable for the version (in the web console), you can upload the dSYM file manually, refer to the Symbolication of the crashes user guide.
Pre-build script for dSYM upload
To automate the dSYM upload and include Apptics-specific information in your app's info.plist, add the below pre-build script in your podfile. The script ensures that the dSYM files are uploaded to the server and the necessary Apptics-specific details are added to the info.plist file (this is essential for the SDK functionality).
Copiedsource 'https://github.com/CocoaPods/Specs.git'
target '[TARGET NAME]' do
pod 'AppticsCrashKit'
# Pre-build script to upload dSYM files and add Apptics information to Info.plist
script_phase :name => 'Apptics Pre build', :script => 'bash "./Pods/Apptics-SDK/scripts/run" --config-file-path="PATH TO CONFIG PLIST FILE" --release-configurations="CONFIGURATIONS COMMA SEPARATED STRING" --app-group-identifier="APP GROUP IDENTIFIER"', :execution_position => :before_compile
end