Skip to content

Give debug builds a .debug applicationId suffix #319

Description

@jeiel85

Split out of #318, where it arrived as a drive-by alongside the launcher-icon fix.

What

buildTypes {
    getByName("debug") {
        applicationIdSuffix = ".debug"
    }
    // ...
}

Why it is worth having

A debug build currently shares com.markleaf.notes with the production app, so
installing one over the other fails with INSTALL_FAILED_UPDATE_INCOMPATIBLE
(different signing keys) on any device that already has the Play/GitHub build.
The workaround today is uninstalling the real app, which throws away its data.
With the suffix the two coexist and verification stops being destructive.

Why it could not land in #318 as-is

.github/scripts/launch-smoke.sh hardcodes the package name in two places:

  • the package-manager poll: adb shell pm path com.markleaf.notes
  • the launch itself: adb shell am start -W -n com.markleaf.notes/.MainActivity

The job installs app/build/outputs/apk/debug/app-debug.apk, so with the suffix
the installed package is com.markleaf.notes.debug and the poll never matches.
launch-smoke would fail on every run and exit with
Package manager never listed com.markleaf.notes after a successful install.

That job is deliberately non-required because it is flaky, but a non-required
check that always fails is worse than no check: it stops carrying any signal.

Scope

  • Add applicationIdSuffix = ".debug" to the debug build type. (isDebuggable = true is the default and is not needed.)
  • Parameterise the package name in .github/scripts/launch-smoke.sh so the poll, the am start component and the error message all follow the suffix.
  • Confirm the FileProvider authority still resolves. It is declared as ${applicationId}.fileprovider, so it should follow automatically, but worth checking a share/export once on device.
  • Check that connectedDebugAndroidTest still targets the right package.

Checked while reviewing #318: no unit test, Roborazzi test or scripts/verify-*.ps1
asserts the literal application id, and SettingsScreen reads it through
BuildConfig.APPLICATION_ID, so the visible "application id" row follows the
suffix by itself. launch-smoke.sh is the only hardcoded consumer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions