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:
LineNumberMapping.json
) for C# code.so
) files for native Android code, including Unity library symbols in libunity.so
.dSYM
) files for iOS codeThe 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):
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.
To generate the files required to fully symbolicate on Android, enable the “Create symbols.zip” option in your Unity build settings:
More information on Unity Android symbol files can be found here in the Unity documentation.
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);
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);
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:
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.
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.