Upload Unity symbols for Android

When you build Android games with Unity using IL2CPP, a symbol ZIP file is generated containing the symbols used in your C# code as well as the Unity framework itself. These files should be uploaded, along with any ProGuard, DexGuard, or R8 mappings and NDK symbol files in order to show full stacktraces in your dashboard.

For installation instructions for the BugSnag CLI, please see our Installation guide.

Overview

The unity-android command uploads the IL2CPP symbols from the .symbols.zip file produced by the Unity build (see Unity documentation for more information) to the NDK symbol API.

$ bugsnag-cli upload unity-android <path> --aab-path <aab-path>

Where <path> is either the symbols ZIP file or the directory containing it. This defaults to the current directory if omitted.

The command will also attempt to upload Android mapping and symbols files from the Android App Bundle (AAB) produced by the Gradle build. If an AAB is located in the same directory as the Unity symbols file (or at the location provided in --aab-path) then the manifest inside it will be used to provide your app’s build information required for the symbol upload.

Example usage

Assuming the symbols ZIP and generated AAB are in the app build directory, the simplest way to run the command is to specify this directory along with the project API key:

$ bugsnag-cli upload unity-android /path/to/build/directory \
    --api-key my-api-key

Alternatively you can provide the symbols ZIP and AAB file paths specifically:

$ bugsnag-cli upload unity-android /path/to/my-game.symbols.zip \
    --aab-path /path/to/my-game.aab \
    --api-key my-api-key

Available options

AAB path (--aab-path)

The path to an AAB file to upload alongside the Unity symbols.

API key (--api-key)

The BugSnag API key for the application.

You can find your API key in Project Settings from your BugSnag dashboard.

Default: the value of com.bugsnag.android.API_KEY in your app’s manifest file, if found.

Application id (--application-id)

A unique application ID, usually the package name, of the application.

Default: the value of Package in your app’s manifest file, if found.

Build UUID (--build-uuid)

A unique identifier for this build of the application.

This is only required if you have multiple mapping files with the same applicationId and versionCode. This same ID must also be set in the BugSnag configuration in your app, so that errors match the uploaded build. See Unique build identifiers for more information.

Dry run (--dry-run)

Performs a dry-run of the command without sending any information to BugSnag.

Fail on upload error (--fail-on-upload-error)

Stops the upload when a file fails to upload successfully.

Log level (--log-level)

Sets the level of logging to debug, info, warn or fatal.

Default: info.

No build UUID (--no-build-uuid)

Prevents the automatically generated build UUID being uploaded with the build.

Overwrite (--overwrite)

Whether to ignore and overwrite existing uploads with same identifier, rather than failing if a matching file exists.

Port (--port)

The port number for the BugSnag upload server.

Default: 443.

Project root (--project-root)

The path to strip from the beginning of source file names referenced in stacktraces on the BugSnag dashboard.

Default: the root directory if the command has detected one, otherwise it’s empty.

Retries (--retries)

The number of retry attempts before failing an upload request.

Default: 0.

Timeout (--timeout)

The number of seconds to wait before failing an upload request.

Default: 300.

Upload API root URL (--upload-api-root-url)

The upload server hostname, optionally containing port number.

For use in BugSnag On-premise configurations. The command will append the appropriate path to access the correct upload endpoint.

Default: https://upload.bugsnag.com.

Verbose (--verbose)

Sets the level of the logging to its highest.

This is the equivalent of setting the log level to debug.

Version code (--version-code)

The version code of this build of the application.

Default: the value of VersionCode in your app’s manifest file, if found.

Version name (--version-name)

The version of the application.

Default: the value of VersionName in your app’s manifest file, if found.