Topics
Recent articles

Android & Mobile

Android Monolith Release Branching: Deploy vs Rollout

Keep the next sprint moving while an Android pilot waits for rollout. Separate Git branches, signed build artifacts, distribution cohorts, and feature flags.

Table of Contents10 sections
Two Android release lines separate pilot build 621 from candidate build 630.
Promote the tested pilot artifact while the next release stays on its own line.

Version 6.2 is on pilot devices. It passed the first round of checks, but the broader rollout has not been approved. The next sprint has already started, and 6.3 needs to get in front of a different group of testers. Then someone reports a crash in 6.2.

At that point, “which branch is production?” is the wrong question. You need to know which commit produced the installed build, who can receive it, and which features those users can access. Those answers can all change independently.

Quick solution:

Keep one stabilization branch per active release. Widen the audience for the tested artifact, not for whatever is currently on main.

release/6.2 -> build 621 -> Pilot A -> wider rollout
release/6.3 -> build 630 -> Pilot B only

This guide uses a fictional release sequence. Deploy means making a signed build available to a selected pilot group; rollout means widening its distribution. Turning a feature on is a separate action.

Branch for the code, not the rollout stage

Keep main as the integration branch. Cut release/6.2 when the scope is stable enough to produce a candidate. After that, the branch accepts only fixes needed for that release. Work on 6.3 continues on main; cut release/6.3 only when it has its own candidate to stabilize.

main          A---B---C---D---E-------F       next sprint
                   |                  |
release/6.2        +---[620]---[621]   |       active pilot line
release/6.3                           +---[630]

[620], [621], [630] = tagged build commits, not rollout states

Don’t keep permanent deploy and rollout branches. A rollout delay doesn’t create a second version of the code. Record distribution changes in the release tracker or distribution platform, not by merging commits between branches.

Question System of record
Which code was built? Release branch, immutable tag, commit SHA
Which build passed the pilot? Package, versionCode, upload artifact hash or provider build ID
Who can install it? Store track or managed-device cohort
Who can use the new feature? Flag targeting and server-side entitlement

Walk through two overlapping releases

Point in time 6.2 line 6.3 line
Start pilot 620 goes to Pilot A; broader rollout is pending Work continues on main
New candidate Pilot A stays on 620 630 is made available to an isolated Pilot B
Fix a pilot crash Produce 621, run the affected regression checks, and replace 620 in Pilot A Ensure the fix is present in 6.3 or its next build
Go/no-go Widen distribution of validated 621, without rebuilding it Keep 630 limited to Pilot B until it passes its own gate

The line about an isolated Pilot B matters. Android uses versionCode to order versions and normally rejects downgrades. On Google Play testing tracks, a user generally receives the highest compatible version code from the tracks they are eligible for. Simply creating two tracks does not isolate a tester eligible for both. Verify which build an account actually receives before you call the cohorts separate.

If a device has already installed 630, it generally cannot take 621 as an ordinary update. Hold that cohort on its current line, issue a forward fix eligible for that cohort, or make an explicit decision that 6.3 will supersede 6.2. Don’t renumber the old file or promise a downgrade. A separate package name can help isolate test builds, but it does not validate the production package’s in-place upgrade and data migration path.

Promote the same build, unless something changed

Record the tag, commit, versionCode, upload artifact checksum or provider artifact ID, pilot cohort, and approval evidence when you upload the candidate. When it passes, widen the audience for that artifact. With an Android App Bundle, the identity to track is the uploaded bundle or provider build, not a claim that every device receives byte-identical APKs.

A code change, resource change, or different signing configuration calls for a new candidate and appropriate revalidation. Changing only the target audience does not. For more on the distribution side, see Android App Updates: Play Store vs Enterprise Managed Device Strategy.

Choose a small first rollout step and define what would stop expansion before you ship: for example, an increase in crash rate by version, a failed upgrade migration, or a drop in completion of a critical user flow. Compare against the prior build, account for a small pilot sample, and name someone who can halt the release. Halting a Google Play staged rollout limits further exposure; it does not remove the update from devices that already installed it.

Keep the hotfix small and port it forward

Patch only the affected release line. If the fix applies cleanly to main, land it there and backport the minimal commit with git cherry-pick -x. If the fix must be developed on the release line first, forward-port it and verify it separately on main and any newer active release branch. Don’t merge main wholesale into the stabilizing branch just to pick up one fix. Git’s cherry-pick documentation explains how the operation applies changes from an existing commit.

A flag can keep a feature off for broad rollout while leaving it available to pilot users. Test both paths, including offline startup with a safe default. But a flag is not a security boundary and won’t undo code that already ran, such as a database migration or eager SDK initialization. Enforce protected operations on the server. If code cannot safely be present while the flag is off, leave it out of the candidate.

Decide what gets a separate release branch

The choice depends on whether a live or pilot build may need a patch after the next sprint has moved. If you can wait for a single train and release every approved change from the same commit, a tag on main is often enough. Cut a release branch when you must actually maintain that earlier line. Open it at the last reproducible commit that contains only the agreed pilot scope, not on the day someone happens to schedule the rollout.

Option Use it when Failure mode Recommendation
Main and tags only The team runs one train and can fix forward Rebuilding an old baseline takes work during an incident Start here if trains rarely overlap
Short-lived release branch per active line An old pilot needs fixes while the next sprint continues A fix can miss a newer line; branch ownership can become unclear Prefer this for overlapping pilots
Permanent deploy and rollout branches The branches would only represent phases of distribution Merging between phases can change what was actually tested Track phases outside Git instead

Retire a release branch once no cohort depends on it for fixes and it is no longer a candidate for promotion. Retain its Git tags, test evidence, and artifact records. At the planning level, limit the number of active release lines deliberately: for example, one pilot line plus one integration or next candidate line. Each extra line costs real regression and support time.

Write the release record before the pilot starts

Start with a small record an on-call engineer can read at a glance: package, version name, versionCode, Git tag and SHA, upload checksum or provider ID, signing configuration reference, target cohort, current feature flags, and the person who can widen or halt distribution. Attach the scope and test evidence. Use distinct operational states such as Uploaded, Pilot Active, Rollout Deferred, and Rollout Approved.

The useful test is whether a teammate can answer three questions without opening the release branch: what is already installed, what would a device receive if it checked for updates now, and which feature behavior would it see? If the release record and the store disagree, stop and reconcile them. A label such as “deployed” should never be used as evidence that a device installed the candidate or that a feature is enabled.

Decide early how you will allocate version codes for each line. In this example, build 621 fits between 620 and 630. That numbering scheme makes the patch easier to reason about, but it never makes 621 install over 630. A centrally assigned sequence can also work if you explicitly model cohort eligibility for the newly numbered patch. Check ordering in the actual distribution service before starting the second pilot, rather than assuming the Git branch name has any effect.

Decide what to do when a pilot is still open

If Pilot A fails, keep the broad audience on its previous build and fix only what Pilot A needs. If it passes but the business window closes, leave its artifact available to Pilot A and defer promotion. If Pilot B is ready first, either keep it isolated or explicitly decide that its artifact supersedes Pilot A. Superseding is a new release decision: recheck the newer artifact against the audience and migration path intended for the old one.

Test the messy transitions, not just clean installations. Upgrade the last broadly distributed build to the candidate with representative data. Put a test account in both groups and verify that the actual offered version matches your expectation. Simulate a deferred rollout with flags off, and confirm the old backend contract still works. If a candidate has already migrated on-device data, turning off the feature may reduce exposure, but the recovery plan still needs to handle devices with the new data shape.

The same distinction helps with managed fleets. Replace “testing track” with the real assignment mechanism, such as a device group, and verify a real cohort member and a deliberately overlapping assignment. Never assume the management layer makes the device eligible for an older build just because its latest policy points there.

The handoff between engineering and rollout operations should state whether “hold” means stop new installations, keep a flag off, or defer a wider distribution step. Those are different actions with different effects on users who already have the build. Verify the behavior in the distribution tool and confirm which decision applies before telling support that a change has been rolled back.

Check rollback boundaries before changing the rollout

Test the recovery behavior of the oldest supported app version and the new candidate against the same backend. A rollout pause does not stop requests from installed copies, and releasing a new client does not make older clients disappear. If a new API field is required, ship the server compatibility change before the clients depend on it. If the pilot writes state older clients cannot read, isolate those writes during the pilot or delay them until you can support both formats.

For an example, suppose build 621 writes a new field when it saves a draft locally. The operational rollback decision is not just whether to stop offering 621. Check that a user already on 621 can still reopen saved drafts after a flag is turned off, and that the hotfix preserves data that 621 already wrote. Store the observed result alongside the release record, with the installed and target version codes. That evidence is more useful in an incident than a green test result with no build identity.

Before rollout, check these five things

  1. Identity: The artifact selected for rollout matches the versionCode and artifact ID or checksum validated in the pilot.
  2. Upgrade: An installed production build upgrades in place; data migration works; the next pilot’s higher version is not offered to the wrong cohort.
  3. Flags: The on, off, and offline-default paths are tested, and protected operations remain authorized by the server.
  4. Stop and recovery: Someone owns the go/no-go decision, knows what to watch, and has a forward-fix plan for devices already upgraded.
  5. Fix propagation: Every newer affected line contains the hotfix, or has a tracked forward-port before its own rollout.

A release branch lets you repair yesterday’s build without stopping tomorrow’s work. The rollout decision belongs to the artifact and its audience, not to the branch name.

You Might Also Like

View all articles
Choosing an Android Stack That Survives Release Day
12 min read

Choosing an Android Stack That Survives Release Day

An in-depth technical guide on evaluating native Kotlin, legacy Java, and Flutter for production Android applications, covering dependency troubleshooting, build inspection, and release readiness.