Upload Unity symbols for iOS

When you build iOS games with Unity using IL2CPP, dSYMs are created when building or archiving the generated Xcode project. These files should be uploaded, along with any Line Mapping 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-ios command uploads the dSYMs for your iOS app to the dSYM API.

The command will also attempt to upload the IL2CPP Unity line mapping file (LineNumberMappings.json), to map native stack frames to C# source files and line numbers. The file should be found automatically, but the --upload-il2cpp-mapping may be used to provide a non-standard location. The upload will fail if no mapping file can be found, unless the --no-upload-il2cpp-mapping flag is set to explicitly opt-out of this functionality.

Example usage

Assuming you have run an Xcode Archive from the generated Unity Xcode project, you can upload the dSYMs and IL2CPP mapping file using:

$ bugsnag-cli upload unity-ios /path/to/unity-project \
    --api-key=YOUR_API_KEY

Alternatively you can provide the path to the Unity project and the upload files specifically:

$ bugsnag-cli upload unity-ios /path/to/unity-project \
    --api-key=YOUR_API_KEY \
    --dsym-path=/path/to/dsyms \
    --upload-il2cpp-mapping=/path/to/LineNumberMappings.json

Available options

API key (--api-key)

The BugSnag API key for the application.

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

Application id (--application-id)

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

Bundle version (--bundle-version)

The bundle version of this build of the application (Apple platforms only).

Configuration (--configuration)

The configuration used to build the application.

Dry run (--dry-run)

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

DSYM path (--dsym-path)

The path to the dSYM file to upload.

Ignore empty dSYM (--ignore-empty-dsym)

Throw warnings instead of errors when a dSYM file is found, rather than the expected dSYM directory.

Ignore missing dwarf (--ignore-missing-dwarf)

Throw warnings instead of errors when a dSYM with missing DWARF data is found.

Log level (--log-level)

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

Default: info.

No upload il2cpp mapping (--no-upload-il2cpp-mapping)

Do not upload the IL2CPP mapping file (LineNumberMappings.json).

Overwrite (--overwrite)

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

Plist (--plist)

The path to a .plist file from which to obtain build information.

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.

Scheme (--scheme)

The name of the Xcode options.Scheme used to build the application.

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.

Upload il2cpp mapping (--upload-il2cpp-mapping)

The path to the IL2CPP mapping file (LineNumberMappings.json) to upload.

Verbose (--verbose)

Sets the level of the logging to its highest.

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

Version name (--version-name)

The version of the application.

Xcode project (--xcode-project)

The path to an Xcode project, workspace or containing directory from which to obtain build information.