Upload debugging symbols from CI/CD pipelines
Automatically upload symbol files from CI/CD pipelines to help diagnose issues in your project.
Read time 7 minutesLast updated 6 hours ago
Automatically upload your project's debug symbols from CI/CD pipelines so that Unity Diagnostics can display human-readable crash reports with function names, file names, and line numbers.
CI/CD pipeline automatic upload process
When you upload debugging symbols from a CI/CD pipeline, the following process automatically occurs:- Your CI pipeline authenticates with a service account and runs one of the provided upload scripts.
- The script validates the service account's credentials and fetches a time-limited token.
- The script uses the CLI bundled with the Unity Editor to upload symbol files to cloud storage.
usymtool
- It validates that all required paths exist, including the binary symbol files, and IL2CPP output.
usymtool - It generates a fresh upload token from the Unity Services API using your service account credentials.
- It derives the correct binary path, symbol path, IL2CPP paths, and flags for your target platform.
usymtool - It runs with the appropriate arguments, passing the token via the
usymtoolenvironment variable.USYM_UPLOAD_AUTH_TOKEN
Prerequisites
Before you begin, make sure you meet the following requirements:- You use Unity 6.2 or later.
- You have a Unity project with Diagnostics Data enabled in your Project Settings. You can also manage this setting per build through Build Profiles.
- You have either the Unity Editor installed on your build machine or CI runner, or the binary extracted from it.
usymtool - You use a build pipeline that produces one of the following types of symbol files:
- .dSYM on macOS and iOS
- .so on Android
- .pdb on Windows
- For macOS, confirm that you have Python 3 installed on your build machine. Most macOS systems have Python 3 pre-installed.
- For Android, you need to configure one or both of the following settings in the Editor:
- In Player Settings > Android > Publishing Settings, turn on Create symbols.zip.
- In Build Profiles, turn on Debug Symbols.
Create a service account
To create a service account, follow these steps:- In the Unity Dashboard, follow the instructions to create a service account.
- In the Project roles section, select Manage project roles.
- Select your project.
- In the LiveOps menu, select Observability Symbols Uploader.
usymtoolDownload the usymtool script
To download theusymtool- In the Unity Dashboard, open your project.
- In your project overview, select View Diagnostics.
- Select Debugging Symbols.
- Select Download CI script.
- Select the corresponding script for your host operating system.
Configure and run the upload script
After you download theusymtool- The binary location
usymtool - Symbol files
- IL2CPP directories
- Log path
- File filters
To configure and run the upload script, follow the instructions for your operating system:
Configure usymtool.sh for the macOS host platform
Before you configure the upload script, make sure you have the following information:- Your Unity Project ID. To find your Unity Project ID in the Unity Dashboard, select your project and go to Settings.
- The Authorization header that you copied in the previous step.
To configure
usymtool.sh- Open the script.
- Fill in the USER CONFIGURATION section with the following information.
Variable | Platforms | Description | Example |
|---|---|---|---|
| All | Target platform | |
| All | Whether the build uses the IL2CPP scripting backend | |
| All | Your Unity Project ID, as found on the Settings tab in the Unity Dashboard | |
| All | Authorization header copied in the previous step | |
| All | Path to Unity Editor installation | |
| All | Path to your Unity project root | |
| macOS, iOS | Path to the build output directory | |
| macOS, iOS | Build product name (used to find the | |
| iOS only | Xcode build products directory containing | Refer to the script comments for a full example path. |
- Run the script locally to verify the configuration.
After you successfully run the script, the messagechmod +x usymtool.sh./usymtool.sh
Auth token acquired successfullyFailed: 0Configure usymtool.ps1 for the Windows host platform
Before you configure the upload script, make sure you have the following information:- Your Unity Project ID, which you can find under Settings in the Unity Dashboard.
- The Authorization header that you copied in the previous step.
usymtool.ps1- Open the script.
- Fill in the USER CONFIGURATION section with the following information.
Variable | Platforms | Description | Example |
|---|---|---|---|
| All | Target platform | |
| All | Whether the build uses IL2CPP | |
| All | Your Unity Project ID, as found on the Settings tab in the Unity Dashboard | |
| All | Authorization header copied in the previous step | |
| All | Path to Unity Editor installation | |
| All | Path to your Unity project root | |
| Windows only | Path to the build output directory | |
| Windows only | Build product name, which is used to find the | |
- Run the script locally to verify your settings.
After you successfully run the script, the message.\usymtool.ps1
Auth token acquired successfullyFailed: 0Override derived paths
If your project layout differs from the default platform-specific paths, you can override any derived path without modifying the platform logic. To override the default configuration, set the corresponding_OVERRIDEMac computer with an Intel x86_64 processor
Although all Unity versions include binaries for both Intel and Apple Silicon processors, theusymtoolContents/ToolsContents/HelpersUSYMTOOL_PATH_OVERRIDEUSYMTOOL_PATH_OVERRIDE="${UNITY_EDITOR_PATH}/Unity.app/Contents/Helpers/usymtool"
USYMTOOL_PATH_OVERRIDE="${UNITY_EDITOR_PATH}/Unity.app/Contents/Tools/macosx/usymtool"
Unity 6 with the Bee build system
If you use Unity 6 with the Bee build system, then the defaultil2cppFileRootIL2CPP_FILE_ROOT_OVERRIDE="."
Integrate with your CI pipeline
After you verify that the script works locally, follow these steps to add the script to your CI pipeline:- Commit the script to a directory in your repository.
scripts/ - Set the following variables in your CI platform:
- : The target platform. For example,
PLATFORM,macos,ios, orandroid.windows - : The path to the Unity Editor on the runner. For example,
UNITY_EDITOR_PATH./Applications/Unity/Hub/Editor/6000.3.10f1 - : The path to the build output directory. For example,
BUILD_OUTPUT_PATH.$GITHUB_WORKSPACE/Build - : Your build product name. For example,
BUILD_NAME.MyGame
- Store the following values in your platform's secrets manager, such as GitHub Secrets or GitLab CI Variables with masking enabled:
- : The authorization header. For example,
UNITY_SA_AUTH_HEADER.Basic MmZiM2Zh... - : Your Unity project ID. For example,
UNITY_PROJECT_ID.12345678-abcd-1234-5678-12345678abcd
- To ensure that no values are hardcoded, inject all configuration from CI variables at runtime.
Verify your upload
The Diagnostics > Debugging Symbols page in the Dashboard shows only symbols uploaded through the Dashboard UI. Any symbols that you upload throughusymtool-
Check the output for the following messages at the end of a successful run:
usymtooltime="<timestamp>" level=info msg="<uuid> successfully uploaded to cloud storage"time="<timestamp>" level=info msg="All <n> uploads completed with out error."time="<timestamp>" level=info msg="Usymtool run completed in <duration>."
- Trigger a crash in a build that matches the uploaded symbols.
- Open the crash report in Diagnostics.
- Confirm that the stack trace in the crash report shows the following instead of raw memory addresses:
- Function names
- File names
- Line numbers