Skip to content

feat(samples): Distinguish debug and release builds of the Android sample#5724

Merged
runningcode merged 1 commit into
mainfrom
no/samples-android-build-type-app-id
Jul 7, 2026
Merged

feat(samples): Distinguish debug and release builds of the Android sample#5724
runningcode merged 1 commit into
mainfrom
no/samples-android-build-type-app-id

Conversation

@runningcode

@runningcode runningcode commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

📜 Description

Makes the debug and release builds of the Android sample app distinguishable:

  • Different application id: debug builds use the .debug application id suffix (io.sentry.samples.android.debug), so debug and release can be installed side by side.
  • Different launcher name: app_name is defined per build type via source-set resources (src/debug / src/release) — Sentry Sample Debug for debug, Sentry Sample for release. The manifest keeps android:label="@string/app_name".
  • In-app build type indicator: a DEBUG/RELEASE badge is shown under the Sentry logo in the navigation rail. Its text comes from a per-build-type build_type string resource; the badge color is keyed on BuildConfig.DEBUG (red for debug, primary for release).

💡 Motivation and Context

When testing SDK changes it's common to have both a debug and a release build of the sample on the same device. Previously they shared an application id and launcher name, so they couldn't coexist and were easy to confuse. This makes it clear at a glance which build you're looking at, both on the home screen and inside the app.

💚 How did you test it?

Built and installed the debug build on an emulator. Verified via aapt2 dump badging that it resolves to package io.sentry.samples.android.debug and label Sentry Sample Debug, coexisting with a release build (io.sentry.samples.android / Sentry Sample). Confirmed both variants process resources cleanly and the red DEBUG badge renders in-app.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

The Maestro flow in sentry-samples/sentry-samples-android/maestro uses appId: io.sentry.samples.android, which now matches the release build only. It is a manually-run dev tool (not in CI); run it against a release build, or point it at the .debug id when testing debug.

Ref: JAVA-631

#skip-changelog

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 0e75a12

@sentry

sentry Bot commented Jul 6, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.47.0 (1) release

⚙️ sentry-android Build Distribution Settings

@runningcode runningcode force-pushed the no/samples-android-build-type-app-id branch from b1c8333 to 12cdeeb Compare July 6, 2026 12:45
…mple

Give the Android sample a `.debug` application id suffix and a
"Sentry Sample Debug" launcher label so debug and release builds can be
installed side by side and told apart on the home screen. Add a build
type badge (DEBUG/RELEASE) under the Sentry logo in the navigation rail
so the running build is visible inside the app too.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@runningcode runningcode force-pushed the no/samples-android-build-type-app-id branch from 12cdeeb to 0e75a12 Compare July 6, 2026 12:47
@runningcode runningcode marked this pull request as ready for review July 6, 2026 12:55
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 282.87 ms 351.71 ms 68.85 ms
Size 0 B 0 B 0 B

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
3d205d0 352.15 ms 432.53 ms 80.38 ms
e59e22a 368.02 ms 432.00 ms 63.98 ms
806307f 357.85 ms 424.64 ms 66.79 ms
d364ace 384.53 ms 453.51 ms 68.98 ms
4c04bb8 307.93 ms 362.34 ms 54.41 ms
bb0ff41 312.86 ms 363.78 ms 50.92 ms
91bb874 310.68 ms 359.24 ms 48.56 ms
11f90db 314.26 ms 372.43 ms 58.17 ms
f6cdbf0 314.19 ms 357.59 ms 43.40 ms
8687935 332.52 ms 362.23 ms 29.71 ms

App size

Revision Plain With Sentry Diff
3d205d0 1.58 MiB 2.10 MiB 532.97 KiB
e59e22a 1.58 MiB 2.20 MiB 635.34 KiB
806307f 1.58 MiB 2.10 MiB 533.42 KiB
d364ace 1.58 MiB 2.11 MiB 539.75 KiB
4c04bb8 0 B 0 B 0 B
bb0ff41 0 B 0 B 0 B
91bb874 1.58 MiB 2.13 MiB 559.07 KiB
11f90db 0 B 0 B 0 B
f6cdbf0 0 B 0 B 0 B
8687935 1.58 MiB 2.19 MiB 619.17 KiB

@linear-code

linear-code Bot commented Jul 6, 2026

Copy link
Copy Markdown

JAVA-631

@runningcode runningcode merged commit 803fad4 into main Jul 7, 2026
36 of 38 checks passed
@runningcode runningcode deleted the no/samples-android-build-type-app-id branch July 7, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants