Crash reports

📘

Minimum supported versions of iOS and Smartlook SDK

The minimum supported iOS version is iOS 13

The minimum supported Smartlook SDK version is 2.1.2

🚧

Crash reports using third-party apps

If you are using third-party apps for your crash reports, Smartlook recommends that you also include dSYMs in your app. For more information, see iOS: Crash reports using third-party services.

Installation

Step 1: Add the Smartlook SDK

If you haven't already, add the Smartlook SDK to your iOS project.

Step 2: Add Smartlook Crash Reports to your app

There are two ways to integrate Smartlook Crash Reports into your app:

Swift Package Manager

Add the Crash Reports Swift Package:

https://github.com/smartlook/crash-reports-swift-package

Direct integration

Crash Reports can also be added directly to your app by downloading our latest Crash Reports framework. Then, unzip the file and add SmartlookCrashReports.xcframework to your Xcode project:

<<current-ios-crash-reports-download>>

Step 3: Provide debug symbols

In order for us to provide you with complete stack traces, we need your app's debug symbols. You can supply your debug symbols (dSYMs) using our CLI tool.

Uploading debug symbols

To provide Smartlook with your debug symbols, you can either upload symbols manually using our CLI tool, or automatically using Xcode run script phase.

Manual upload

  1. Install the Smartlook Crash Reports CLI tool using Homebrew:
brew install smartlook/smartlook/smartlook-crash-reports-cli
  1. Upload your dSYMs
smartlook-crash-reports upload-mapping-file --force --platform apple --token <YOUR_REST_API_TOKEN> --bundleId <BUNDLE_NAME> --appVersion <MARKETING_VERSION> --path <PATH_TO_SYMBOL_FILES>

You need to provide your REST API token, bundle name in form of com.company.app, and the version of your application (1.0.0, or other).

📘

Accepted file types

You can provide either actual dSYM file to the --path argument, or a directory containing dSYM files. If you have .xcarchive, you can provide that as well. The .xcarchive will be scanned for dSYM files, bundle name, and application version will be extracted from the package.

Automatic upload using Xcode build phase

  1. Install the Smartlook Crash Reports CLI tool using Homebrew:
brew install smartlook/smartlook/smartlook-crash-reports-cli
  1. Create a new Run Script Phase for your project's target. Copy the script and enter your REST API token.
# Adds support for Apple Silicon brew directory
export PATH="$PATH:/opt/homebrew/bin"

export SL_API_TOKEN=<YOUR_REST_API_TOKEN>

if which smartlook-crash-reports > /dev/null; then
    export SL_BUNDLE_ID=$PRODUCT_BUNDLE_IDENTIFIER
    export SL_APP_VERSION=$MARKETING_VERSION
    
    SL_CMD_OUTPUT=$(smartlook-crash-reports upload-mapping-file \
        --platform apple --token $SL_API_TOKEN \
        --bundleId $SL_BUNDLE_ID --appVersion $SL_APP_VERSION \
        --path "$DWARF_DSYM_FOLDER_PATH" \
        --force)    
else
    echo "warning: smartlook-crash-reports not installed, download from https://mobile.developer.smartlook.com/reference/crash-reports"
fi

📘

Script configuration

Be sure to set the SL_API_TOKEN variable to your REST API token.

  1. Uncheck the Based on dependency analysis checkbox
  2. We recommend checking the For install builds only to upload dSYMs for release builds only. If you want to upload symbols for Debug builds as well, make sure you have Debug Information Format set to DWARF with dSYM File for Debug configuration in Project build settings.

Apps with Bitcode

  1. Open the Organizer in Xcode.
  2. Find the archive for your app and click Download Debug Symbols.
  3. Use the CLI tool to upload debug symbols.