Upload debugging symbols from CI/CD pipelines
Automatically upload symbol files from CI/CD pipelines to help diagnose issues in your project.
読み終わるまでの所要時間 7 分最終更新 2ヶ月前
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
The scripts handle the complete upload workflow:
- 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
You don't need to track when tokens expire. Each token is valid for seven days, and the scripts use the token API to automatically generate a fresh token on every run.
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
Depending on which platform you use, you also need to meet additional requirements:
- 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.
After you add the required role, the service account is configured to work with the script.
usymtoolDownload the usymtool script
To download the script, follow these steps:
usymtool- 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.
After you select the script, the script file is downloaded to your default download location.
Configure and run the upload script
After you download the script, you need to configure it for your operating system.
usymtoolBoth the macOS and Windows scripts automatically derive the following platform-specific paths:
- 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 for the macOS host platform, follow these steps:
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.
chmod +x usymtool.sh./usymtool.sh
After you successfully run the script, the message is displayed, with reported in the upload summary.
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.
To configure for the Windows host platform, follow these steps:
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.
.\usymtool.ps1
After you successfully run the script, the message is displayed, with reported in the upload summary.
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 variable in the ADVANCED section of the script.
_OVERRIDEYou might need to use an override if you use one of the following:
For additional override and troubleshooting information, refer to Troubleshooting symbol file uploads from CI/CD pipelines.
Mac computer with an Intel x86_64 processor
Although all Unity versions include binaries for both Intel and Apple Silicon processors, the script defaults to the paths for Apple Silicon processors. If you use a Mac computer with an Intel x86_64 processor, then you need to set an override to ensure that the script runs the correct binary.
usymtoolStarting with Unity 6.3, macOS tools moved from to . Depending on your Unity version, add the corresponding line to set to the Intel binary:
Contents/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 default folder might not match the relative paths embedded in your symbol files.
il2cppFileRootTo override the default path and set it to the current directory, add the following line to the script's ADVANCED section:
IL2CPP_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.
After you add the script with all CI variables, the pipeline is fully automated.
For sample runner code that you can use for various host and target platforms, refer to Runner examples for uploading debugging symbols from CI/CD pipelines.
Verify your upload
The Diagnostics > Debugging Symbols page in the Dashboard shows only symbols uploaded through the Dashboard UI. Any symbols that you upload through don't appear on this page.
usymtoolTo verify that your CI upload is successful, follow these steps:
-
Check theoutput 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
If all information appears as expected, then the upload process is complete.