Showing full stacktraces

BugSnag supports unminifying and demangling C# and native stacktraces to show a full stacktrace with methods, file paths and line numbers for Android and iOS platforms.

To do this, the following file types may need to be uploaded:

  • IL2CPP mapping files (LineNumberMapping.json) for C# code
  • ProGuard, DexGuard and R8 mapping files for Android (Kotlin/Java) code
  • Android NDK symbols (.so) files for native Android code, including Unity library symbols in libunity.so
  • Apple symbol (.dSYM) files for iOS code

Automatic symbol upload

The BugSnag Unity SDK includes a PostBuildProcess to upload all the symbolication files for your Android, iOS or macOS app after a build.

This can be enabled via the BugSnag menu (or configuration window):

Enable Symbol Upload dropdown menu

Or in a build script before building:

var buildTimeSettingsObject = BugsnagSettingsObject.LoadBuildTimeSettingsObject();
buildTimeSettingsObject.AutoUploadSymbols = true;
EditorUtility.SetDirty(settingsObject);

The asset is set to Dirty so that Unity recognizes the changes before build compilation.

Android symbol generation

To generate the files required to fully symbolicate on Android, enable the “Create symbols.zip” option in your Unity build settings:

Create symbols.zip

More information on Unity Android symbol files can be found here in the Unity documentation.

On-premise configuration

If you are using BugSnag On-premise you’ll need to set the Upload endpoint in the BugSnag configuration window or by setting the UploadEndpoint option in code:

var buildTimeSettingsObject = BugsnagSettingsObject.LoadBuildTimeSettingsObject();
buildTimeSettingsObject.UploadEndpoint = "http://my-upload-endpoint.com";
EditorUtility.SetDirty(settingsObject);

BugSnag CLI

The uploads are performed by the BugSnag CLI, which is installed as part of the BugSnag Unity SDK. To manage the version and location of the CLI yourself, set the executable path in the BugSnag configuration window or by setting the BugsnagCLIExecutablePath in code:

var buildTimeSettingsObject = BugsnagSettingsObject.LoadBuildTimeSettingsObject();
buildTimeSettingsObject.BugsnagCLIExecutablePath = "Absolute/Path/To/CLI/Installation";
EditorUtility.SetDirty(settingsObject);

Manual symbol upload

The following uploads are required to fully symbolication your Android and iOS apps. To script a bespoke upload process, we recommend using the BugSnag CLI which provides a command for each file type and an extensive set of options to suit your app and build process.

The following commands will be required to upload all the files for Android and iOS apps:

Android

The unity-android command will upload the ProGuard mapping files, NDK symbols (.so files), Unity library symbols (symbols.zip) and IL2CPP mapping file when provided with the path in which the app was built:

$ bugsnag-cli upload unity-android --api-key=your-api-key path/to/build/directory

See the unity-android command reference for a list of the available options to customize the upload for your app.

iOS

The unity-ios command can upload LLVM debug symbol maps (dSYMs) and the IL2CPP mapping file from your generated Xcode project after you have archived your project:

$ bugsnag-cli upload unity-ios --api-key=your-api-key --xcode-project=/path/to/exported/xcode/project path/to/your/unity/project

See the unity-ios command reference for a list of the available options to customize the upload for your app.