Skip to content

Commit 39e7629

Browse files
feat(unity): Added additional platforms to native support (#5109)
* improved native support docs * Update src/includes/getting-started-primer/unity.mdx Co-authored-by: Isabel <[email protected]> * Update src/platforms/unity/native-support/index.mdx Co-authored-by: Isabel <[email protected]> * Update src/platforms/unity/native-support/index.mdx Co-authored-by: Isabel <[email protected]> * Update src/platforms/unity/native-support/index.mdx Co-authored-by: Isabel <[email protected]> * Update src/platforms/unity/native-support/index.mdx Co-authored-by: Isabel <[email protected]> * Update src/platforms/unity/native-support/index.mdx Co-authored-by: Isabel <[email protected]> Co-authored-by: Isabel <[email protected]>
1 parent 2f4f99f commit 39e7629

File tree

2 files changed

+26
-9
lines changed

2 files changed

+26
-9
lines changed

src/includes/getting-started-primer/unity.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ Our Unity SDK builds on top of the [.NET SDK](/platforms/dotnet/) and extends it
55
- [Native support](/platforms/unity/native-support/) for automatic crash error tracking for
66
- Android by using the [Android SDK](/platforms/android/) to support Java, Kotlin, C and C++
77
- iOS by using the [iOS SDK](/platforms/apple/guides/ios/) to support Objective-C, Swift, C and C++
8-
- Windows by using the [Native SDK](/platforms/native/) to support C and C++ with minidumps.
8+
- Windows and Linux by using the [Native SDK](/platforms/native/) to support C and C++ with minidumps
9+
- macOS by using the [macOS SDK](/platforms/apple/guides/macos/) to support Objective-C, Swift, C and C++
910
- [Offline caching](/platforms/unity/configuration/options/#cache-directory-path) stores event data to disk in case the device is not online
1011
- [Release health](/platforms/unity/configuration/releases/) to keep track of crash free users and sessions
1112
- [Breadcrumbs automatically](/platforms/unity/enriching-events/breadcrumbs/#automatic-breadcrumbs) captured for

src/platforms/unity/native-support/index.mdx

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,41 @@ The setup for the iOS and Android native SDKs happens during build time, with th
1414

1515
</Note>
1616

17-
## Android
17+
## Mobile
18+
19+
The native crash support for Android and iOS is achieved by modifying the generated platform-specific projects during build time. That way, the Sentry native crash support gets initialized before Unity, making it possible to capture errors of the Unity engine itself.
20+
21+
### Android
1822

1923
When chosing Android as a build target, Unity creates a Gradle project. During the Unity build process, the SDK embeds the [Android SDK](/platforms/android/), as well as the provided options, by adding it to the generated project's Android Manifest.
2024

21-
## iOS
25+
### iOS
2226

2327
When building your game for iOS, Unity exports it as an Xcode project. By modifying that generated project, the SDK adds the [iOS SDK](/platforms/apple/guides/ios/) to provide native support. It adds the initialization code to the `main.m` and generates the options provided by the editor configuration window as `SentryOptions.m`. The SDK also copies the `SentryNativeBridge` that enables the C# layer to communicate with the iOS SDK. This means that there's no need to use the Unity [built-in crash reporting](https://docs.unity3d.com/ScriptReference/CrashReport.html) functionality.
2428

2529
The [iOS SDK](/platforms/apple/guides/ios/) supports capturing Objective-C exceptions which are disabled in the generated Xcode project by default. Consider enabling them in the "Build Settings" tab by setting `GCC_ENABLE_OBJC_EXCEPTIONS` to true.
2630

27-
## Windows
31+
## Desktop
32+
33+
The native support is configured and enabled as early as possible by the C# layer, right after the Unity engine starts. This is slightly different from on mobile where we inject native initialization code that runs before the Unity engine runs.
34+
35+
### Windows
36+
37+
On Windows, the Unity SDK includes the [Native SDK](/platforms/native/) with the crashpad backend. Windows native crashes are automatically captured through minidumps. To upload these to Sentry, the SDK copies the `crashpad_handler.exe` to the build output directory at the end of the build process. This executable must be included when shipping your game.
38+
39+
### macOS
40+
41+
The Native Support on macOS relies on the [macOS SDK](/platforms/apple/guides/macos/). Stackwalking happens in process.
42+
43+
### Linux
2844

29-
Windows native crashes are automatically captured through minidumps. The Native Support is configured and enabled as early as possible by the C# layer, right after the Unity engine starts. This is slightly different than the Android and iOS support where we inject native initialization code that runs before Unity engine runs.
45+
On Linux the Unity SDK includes the [Native SDK](/platforms/native/) with the breakpad backend. A minidump is created in process and no handler executable is required.
3046

3147
## Debug Symbols
3248

33-
Sentry requires [debug information files](/platforms/android/data-management/debug-files/) to symbolicate your crash logs. The Unity SDK provides an automated upload functionality for those symbol files that rely on the [sentry-cli](/product/cli/). We've included the executables for Windows, macOS, and Linux inside the Unity SDK package.
49+
Sentry requires [debug information files](/platforms/unity/data-management/debug-files/) to symbolicate your crashes. The Unity SDK provides an automated upload functionality for those symbol files that rely on the [sentry-cli](/product/cli/). This is done transparently so you're not required to run `sentry-cli` manually. The symbol upload happens during Unity build in the editor. We've included the executables for Windows, macOS, and Linux as part of the Unity SDK package.
3450

35-
The automated debug symbols upload is enabled by default but requires configuration. Go to **Tools > Sentry > Editor** to enter the [Auth Token](https://sentry.io/api/), Org Slug, and the Project Name. Note that the Unity SDK creates a file at `Assets/Plugins/Sentry/SentryCliOptions.asset` to store the configuration, that should not be made publicly available.
51+
The automated debug symbols upload is enabled by default but requires configuration. Go to **Tools > Sentry > Editor** to enter the [Auth Token](https://sentry.io/api/), Organization Slug, and the Project Name. Note that the Unity SDK creates a file at `Assets/Plugins/Sentry/SentryCliOptions.asset` to store the configuration, that should **not** be made publicly available.
3652

3753
### iOS - dSYM and Bitcode
3854

@@ -42,13 +58,13 @@ For Sentry to symbolicate your crash logs and with `bitcode` enabled, we need tw
4258
1. `dSYM` files available only **after** App Store Connect finishes processing the build
4359
2. `BCSymbolMap` files that are created during the archiving process
4460

45-
The automated symbol upload will take care of the `BCSymbolMap` files by processing them during the archiving process. To provide the dSYM files to Sentry, you can either set up the [App Store Connect Integration](/platforms/apple/guides/ios/dsym/#bitcode-appstore) so Sentry can fetch them for you or download and then upload them [manually using sentry-cli](/platforms/apple/guides/ios/dsym/#bitcode-sentrycli).
61+
The automated symbol upload will take care of the `BCSymbolMap` files by processing them during the archiving process. To provide the dSYM files to Sentry, you can either set up the [Sentry App Store Connect Integration](/platforms/apple/guides/ios/dsym/#bitcode-appstore) so Sentry can fetch them for you, or download them from Apple and then upload them [manually using sentry-cli](/platforms/apple/guides/ios/dsym/#bitcode-sentrycli).
4662

4763
With `bitcode` disabled, the automated symbols upload will pick up the `dSYM` files at the end of the build process without further action required.
4864

4965
### Manual Upload Using sentry-cli
5066

51-
You can either use the provided executables from within the package or follow the [sentry-cli documentation](/product/cli/installation/) to make it available globally. To upload debug symbols, run it with:
67+
If you don't want to rely on the automated symbol upload, you can run `sentry-cli` through the commandline. For that, you can use the provided executables from within the package or follow the [sentry-cli documentation](/product/cli/installation/) to make it available globally. To upload debug symbols, run it with:
5268

5369
```bash
5470
sentry-cli --auth-token YOUR_AUTH_TOKEN upload-dif --org ___ORG_SLUG___ --project ___PROJECT_SLUG___ PATH_TO_SYMBOLS

0 commit comments

Comments
 (0)