BugSnag supports unminifying and demangling stacktraces using ProGuard, DexGuard, and R8 mapping files, Unity library symbols, NDK symbols and LLVM debug symbol maps (dSYMs), to show a full stacktrace with methods, file paths, and line numbers for Android, iOS and macOS projects in Unity.
Filenames for Stacktraces may not be available in production builds, due to optimizations in Unity which remove this information. Currently we display “unknown file” in this scenario.
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):
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/Instilation";
EditorUtility.SetDirty(settingsObject);
The following uploads are required to fully symbolication your Android, iOS and macOS 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, iOS and macOS apps:
The unity-android
command will upload the ProGuard mapping files, NDK symbols (.so files) and Unity library symbols (symbols.zip
) 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 xcode-archive
command will upload LLVM debug symbol maps (dSYMs) from generated .xcarchive
files:
$ bugsnag-cli upload xcode-archive --api-key=your-api-key path/to/generated/MyApp.xcarchive
See the xcode-archive
command reference for a list of the available options to customize the upload for your app. You can also upload .dSYM
files directly using the xcode-build
command.