The following tools are required before you can build and develop the SDK:
| Tool | Notes |
|---|---|
| Unity Hub | Required for managing Unity installations |
| Unity with iOS Build Support | The iOS module is required by Sentry.Unity.Editor.iOS. Install via Unity Hub. |
| .NET SDK | Version pinned in global.json |
| PowerShell | Install via dotnet tool install --global PowerShell |
| GitHub CLI | Required for downloading prebuilt native SDKs. On macOS: brew install gh |
After installing the .NET SDK and PowerShell, restore the required workloads:
dotnet workload restoreDepending on which platforms you're targeting, you may also need:
- Android Build Support
- Desktop Platforms (Windows, macOS, Linux)
- WebGL
git clone https://github.com/getsentry/sentry-unity.git
cd sentry-unityThis step downloads prebuilt native libraries for Android, Linux, and Windows from the latest successful CI build. This is the fastest way to get started.
dotnet msbuild /t:DownloadNativeSDKs src/Sentry.Unitydotnet buildThat's it! The SDK is now built and ready for development.
Note: Submodules (sentry-dotnet, Ben.Demystifier) are restored automatically. If this fails, run
git submodule update --init --recursive.
Note: The build also downloads and caches Sentry CLI and the Sentry SDK for Cocoa automatically.
If you need to build the native SDKs yourself instead of using prebuilt artifacts, follow the setup instructions below.
Required tools:
- CMake
- A supported C/C++ compiler
Required tools:
- Git (accessible from
PATH) - Android Studio
- JDK 17 (via sdkman or OpenJDK)
Android Studio Setup:
- Open Android Studio → Customize → All settings...
- Search for "SDK" → System Settings → Android SDK
- Install the Android SDK
- Switch to SDK Tools tab
- Check "Show Package Details"
- Under Android SDK Build-Tools, check "34"
- Apply
Environment Variables:
- Set
ANDROID_HOME:- macOS:
export ANDROID_HOME="$HOME/Library/Android/sdk" - Windows:
setx ANDROID_HOME "%localappdata%\Android\Sdk"
- macOS:
- Ensure
javais on your PATH (verify withjava --version)- Windows: Add the JDK
binfolder to PATH
- Windows: Add the JDK
Run from the command line:
dotnet msbuild /t:"UnityPlayModeTest;UnityEditModeTest" /p:Configuration=Release test/Sentry.Unity.TestsOr use the TestRunner window inside the Unity Editor.
Run integration tests locally using the same scripts as CI:
pwsh ./test/Scripts.Integration.Test/integration-test.ps1 -Platform "Android" -UnityVersion "6000"See the script for additional optional parameters. Supported platforms include Android, iOS, macOS, Windows, and Linux.
package-dev/- Development UPM packagepackage/- Release package template (used for publishing)samples/unity-of-bugs/- Sample Unity project for local testingsrc/- Source codetest/- Tests and integration test scripts
- Open
src/Sentry.Unity.slnin your IDE (e.g., Rider, Visual Studio) - Build the solution — artifacts are placed in
package-dev/ - Open
samples/unity-of-bugsvia Unity Hub - Configure via Tools → Sentry and enter your DSN
- Click Play and test your changes
The build uses the Unity version from samples/unity-of-bugs/ProjectSettings/ProjectVersion.txt. To use a different version:
export UNITY_VERSION=2022.3.44f1CI validates that package contents don't change accidentally. To accept intentional changes:
pwsh ./test/Scripts.Tests/test-pack-contents.ps1 acceptTo build, alias, package, and update the snapshot in one step:
pwsh ./scripts/repack.ps1Ensure the repository is clean before running
repack.ps1.
Releases are published by pushing CI-built artifacts to the unity package repo. The package directory contains template files used during this process.
Do not copy
package-devspecific files (package.json,*.asmdef) intopackage.