Uploading dSYM files on iOS
Information about crashes on iOS is sent in unsymbolicated crash logs. It's difficult to extract data for analysis from these crash logs. To analyze the crash logs, upload dSYM files to AppMetrica.
The AppMetrica SDK has a built-in command-line tool named helper for uploading dSYM files. To build an app based on fastlane, use the upload plugin. It helps you set up automatic dSYM file uploads when building your app.
Automatic uploading when building an app
Use fastlane to build your app:
-
Install the
appmetrica
fastlane plugin:fastlane add_plugin appmetrica
For more information about how to add the plugin, see fastlane docs.
-
Add the following to the
fastlane/Fastfile
file:lane :release do # Your actions before. gym( workspace: "MyApp.xcworkspace", configuration: "Release", scheme: "MyApp", export_method: "app-store" # Pass the correct export_method. ) upload_symbols_to_appmetrica(post_api_key: "Post API key") # Your actions after. end
You can get the Post API key in the AppMetrica Settings. It's used to identify your app.
Alert
Apps are built using the gym action with export enabled. If you build your app using Xcode, the app is recompiled after you upload it to App Store Connect. In this case, you won't be able to use the dSYM files generated during the build.
-
Add a stage for uploading dSYM files via the
helper
. Thehelper
tool has been supported since version 3.8.0 of the AppMetrica SDK. It's in the SDK archive. Helper tool reference.-
Open the project in Xcode.
-
In the project navigator, select the project file.
-
In the Targets block, select your app.
-
Open the Build Phases tab.
-
Click + → New Run Script Phase.
-
Add the following to the Type a script field:
if [ -d "${PODS_ROOT}/AppMetricaCrashes" ]; then HELPER_PATH=`find "${PODS_ROOT}/AppMetricaCrashes" -name "helper"` if [ -x "${HELPER_PATH}" ]; then "${HELPER_PATH}" auto --post-api-key="Post API key"& else echo "AppMetrica crash helper was not found" fi fi
Note
auto
mode uses theCONFIGURATION
environment variable. If the build is done with theDebug
configuration, no dSYM files are uploaded.
-
Uploading a missing dSYM file
If a dSYM file wasn't uploaded when building an app, crash reports contain a warning about unsymbolicated crashes.
To symbolicate them, upload the missing dSYM files. You can view the list of missing files on the Settings → Crashes page of your app in AppMetrica.
You can upload missing dSYM files:
-
Install the
appmetrica
fastlane plugin:fastlane add_plugin appmetrica
For more information about how to add the plugin, see fastlane docs.
-
Add the following to the
fastlane/Fastfile
file:lane :refresh_dsyms do download_dsyms upload_symbols_to_appmetrica(post_api_key: "Post API key") clean_build_artifacts end
In the
download_dsyms
action, you can specify the required app version and build number:... download_dsyms(version: "1.0.0", build_number: "345") ...
Learn more about the
download_dsyms
action in the fastlane documentation.
-
Find the necessary archive with the dSYM file:
Via Xcode Organizer
- In the Xcode interface, click Window → Organizer.
- In the Archives tab, select the appropriate app version.
- Click Download dSYM.
Via App Store Connect
- In the iTunes Connect interface, open the Activity page.
- In the All Builds tab, select the appropriate build number.
- Click Download dSYM.
You can use the dSYM file that was generated during the build.
-
In the AppMetrica interface, go to the app settings from the menu on the left.
-
Open Crashes → iOS.
-
Click Choose file and upload the ZIP archive containing the
app.dSYM
orapp
directory.
Alert
This option is only suitable for apps that are built without Bitcode.
To use the plugin, install the AppMetrica SDK with version 3.8.0 or higher. To upload missing dSYM files to AppMetrica, run the following command in the terminal:
helper -k <post-api-key> <file_path>
file_path
— A list of dSYM files or the folders where they're stored.
Helper tool reference
Note
The helper
tool has been supported since version 3.8.0 of the AppMetrica SDK. It's in the SDK archive.
Helper is a command-line tool that lets you upload dSYM files to AppMetrica.
$ helper [auto] [-o | --package-output-path=<path>] [-v | --verbose]
[--version] -k <post-api-key> | --post-api-key=<key> [file ...]
Parameters
|
Auto upload mode. In this mode, the
|
|
Post API key. You can get the Post API key in the Settings of AppMetrica. It's used to identify your app. |
|
The path to the folder where temporary files are stored. By default, the system folder is used. |
|
Enables the display of additional information. |
|
Outputs the version. |
|
The list of dSYM files or folders where they're stored. By default, the local working folder is used. |
&
lets you run the helper
concurrently, without blocking the build of the entire project. Sample command:
helper auto --post-api-key="Post API key"&
See also
If you didn't find the answer you were looking for, you can use the feedback form to submit your question. Please describe the problem in as much detail as possible. Attach a screenshot if possible.
You can get the Post API key in the AppMetrica Settings. It's used to identify your app.