diff --git a/CHANGELOG.md b/CHANGELOG.md index e0aa96f988..df0ba2bbeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,28 @@ ## Unreleased +### Features + +- Add env flag `SENTRY_DISABLE_NATIVE_DEBUG_UPLOAD` to allow disabling the debug file upload ([#4223](https://github.com/getsentry/sentry-react-native/pull/4223)) + + How to use in Android project? It works by default, just set `export SENTRY_DISABLE_NATIVE_DEBUG_UPLOAD=true` in your build environment. For Sentry Android Gradle Plugin add the following to your `android/app/build.gradle`. + + ```gradle + apply from: "../../../sentry.gradle" + + sentry { + autoUploadProguardMapping = shouldSentryAutoUpload() + uploadNativeSymbols = shouldSentryAutoUpload() + } + ``` + + How to use in Xcode? Make sure you are using `scripts/sentry-xcode.sh` and `scripts/sentry-xcode-debug-files.sh` in your + build phases. And add the following to your `ios/.xcode.env.local` file. + + ```bash + export SENTRY_DISABLE_NATIVE_DEBUG_UPLOAD=true + ``` + ### Fixes - Skips ignoring require cycle logs for RN 0.70 or newer ([#4214](https://github.com/getsentry/sentry-react-native/pull/4214)) diff --git a/packages/core/scripts/sentry-xcode-debug-files.sh b/packages/core/scripts/sentry-xcode-debug-files.sh index 8788c2f30a..60cca3661f 100755 --- a/packages/core/scripts/sentry-xcode-debug-files.sh +++ b/packages/core/scripts/sentry-xcode-debug-files.sh @@ -35,6 +35,8 @@ XCODE_BUILD_CONFIGURATION="${CONFIGURATION}" if [ "$SENTRY_DISABLE_AUTO_UPLOAD" == true ]; then echo "SENTRY_DISABLE_AUTO_UPLOAD=true, skipping debug files upload" +elif [ "$SENTRY_DISABLE_XCODE_DEBUG_UPLOAD" == true ]; then + echo "SENTRY_DISABLE_XCODE_DEBUG_UPLOAD=true, skipping native debug files upload" elif echo "$XCODE_BUILD_CONFIGURATION" | grep -iq "debug"; then # case insensitive check for "debug" echo "Skipping debug files upload for *Debug* configuration" else diff --git a/packages/core/sentry.gradle b/packages/core/sentry.gradle index 640f9a3b28..e5630ef458 100644 --- a/packages/core/sentry.gradle +++ b/packages/core/sentry.gradle @@ -4,7 +4,8 @@ import java.util.regex.Matcher import java.util.regex.Pattern project.ext.shouldSentryAutoUpload = { -> - return System.getenv('SENTRY_DISABLE_AUTO_UPLOAD') != 'true' + return System.getenv('SENTRY_DISABLE_AUTO_UPLOAD') != 'true' || + System.getenv('SENTRY_DISABLE_NATIVE_DEBUG_UPLOAD') != 'true' } def config = project.hasProperty("sentryCli") ? project.sentryCli : [];