Ramiz RajaBook a call
← Writing
Release Engineering

Release Management for Mobile Apps: Four Gates I Run Before Upload

I read the release scripts and git history of my Ping apps for what went wrong at the store boundary, and what the scripts check now.

Ramiz RajaNovember 23, 20268 min read
Release Management for Mobile Apps: Four Gates I Run Before Upload

ChatPing's iOS repo started with the wrong app icon. Its first scaffold commit copied LeadPing's 1024 px icon byte for byte, a green "L" where ChatPing's mark should have been, and nothing in the repo ever asked whose icon it was.

Mobile release management covers preparing a build, verifying the upgrade, submitting it for review and controlling the rollout. The four checks in this article cover failures I found before and around submission, in the release scripts and git history of my Ping apps.

Why release management for mobile apps is different

On the web you revert and redeploy. On mobile, you can stop distributing a version, but you can't take it back off a phone.

A public release has to pass store review before users get it. On Google Play, a staged rollout sends an update to a percentage of users. If you halt it, "no additional users will receive the app version", but users who already received it "will remain on that version". Play can also halt an eligible fully rolled-out release and serve the previous version to new and eligible users, which limits the damage without being a revert for everyone.

Apple's phased release spreads an update over 7 days to a random sample of users with automatic updates, and the same page says anyone can still download it manually at any time. A pause slows the spread. It doesn't contain it.

The binary carries its own identity too: signing, version and bundled icon. Listing text can be edited separately, but those three need a new build. So I count a check as part of my release management process only if a script runs it before upload.

The icon that came in with the fork

ChatPing's release history records a TestFlight upload that still bundled LeadPing's icon. The commit that fixed it explains the cause: ChatPing began as a fork, and both icon files hashed to the same sha256.

The fix had two parts. The icon became a derived artefact, regenerated from one SVG by scripts/regenerate-app-icon.py. And scripts/verify-app-icon-identity.sh became a gate that fails if the icon set isn't 1024 px and opaque, or hashes to anything in a committed denylist of 12 hashes. Each foreign icon is hashed three ways (file, 64x64 RGBA, 64x64 RGB), which catches exact matches at the file and normalized pixel level. When sibling repos are checked out, the script also compares against their icons and reports near-identical ones. I wired it into the two pre-upload scripts and thought I was done.

I wasn't. A follow-up commit records why: the guard was "reachable only by convention". Two shell scripts called it, so calling a Fastlane lane directly skipped the check. It also verified the default icon set without asking which set the build compiles, so an unused set could pass. The commit moved the call into Fastlane, as the first icon check in all six lanes that build or upload, and added a check that the Release build's icon name is the set being hashed.

Here's the TestFlight lane, trimmed and with the app name removed:

lane :beta do
  store_gates!
  verify_app_icon_identity! # before match/gym/upload_to_testflight, always
  changelog = verify_release_notes!
  api_key = app_store_connect_api_key(**asc_key_options)
  match_and_export_ipa(api_key, output_directory: "build/beta", output_name: "App-beta")
  verify_build_number!("build/beta/App-beta.ipa")
  upload_to_testflight(api_key: api_key, ipa: "build/beta/App-beta.ipa", changelog: changelog)
end

A release management process, gate by gate

GateWhat it guards againstWhere it runs
App icon identityA sibling app's icon in the buildSix Fastlane build and upload lanes
Store listing and legal linksAnother platform's name in a listing, missing Terms or Privacy linksCI on PRs and main, plus five iOS lanes
R8 audit freshnessAn audit that no longer describes the code being deployedLocal deploy script
Upgrade-install and owner rulingsLost local data on upgrade, and behaviour testers ruled outiOS release check script

Two rejections that became a CI job

My shared rules file records the cause. ReelSavePing's iOS release was rejected on guideline 3.1.2(c) because the app had no Terms of Use link, and on 2.3.10 because the App Store description said "Android". Neither is a code bug. I didn't record what that round trip cost in days, but I can show what changed.

scripts/check-store-gates.py scans two things. Gate 1 scans selected listing files for platform names and skips lines explicitly marked as allowed: iOS metadata must not say Android, Google Play or Play Store, and Play listing text must not say iPhone, iPad, iOS, App Store or TestFlight. That Play word list is my house rule. Gate 2 looks for Terms or EULA and Privacy text in candidate purchase UI files and their siblings, and checks candidate Settings and About files collectively. Requiring both in Settings is also my house rule. A text match doesn't show that a link opens, so that stays a manual check on a device.

ChatPing iOS adopted the same checks with a GitHub Actions workflow that runs on every pull request and on pushes to main, and a store_gates! call at the top of five Fastlane lanes: beta, release_prep, publish_store, finalize_metadata and submit_store.

Eight of the ten repos I checked have this gate on main. In the two ClickPing repos it's still on an unmerged branch, so they aren't covered yet.

The same version, rebuilt: R8 and version codes

Over two consecutive days, ChatPing Android has six "Release" commits for four version names. Two of those version names appeared in two release commits each. I read the history of the second one to see why.

Its first release commit was followed by a dictation fix that cancels dictation on Send and when the app goes to the background, then a pin bump of the shared UI kit that carried a related fix. Both are code R8 can see. This is an existing gate doing its job: scripts/check-r8-audit.sh reads the Audited SHA from the latest audit report, compares it with HEAD, and also checks the working tree. The committed diff excludes docs, QA files, Markdown, .gitignore and version.properties. The working-tree check uses the same exclusions except for Markdown. The new report says why it re-ran: "because scripts/check-r8-audit.sh counts any non-docs change as drift". That run took 6 minutes 26 seconds on the build machine. Then a one-line commit bumped the version code under the same version name.

I can't say whether the first build reached any tester, because the history doesn't show it. What it does show is the cost of a late fix: a re-audit, a new code and another release commit. There's a second data point on version codes. A different bump commit is titled to say the previous code was already used on Play, so that code was skipped. My release.sh bumps the code and tags v<versionName> from main only after a clean tree and a fast-forward pull, and check_play_version.py takes the maximum code the Play API returns across bundles and tracks. The history doesn't say why that bump was still needed.

Treat version codes as a ledger you append to. If Play has already accepted an artifact with a code, its replacement needs a new one.

Upgrade-install proof: what TestFlight feedback added

ChatPing iOS went to TestFlight and the feedback came back as owner rulings. The file that recorded them (docs/OWNER-RULINGS.md) lists four. The first is the one I care about most: a user-selected on-device route must never fall back to cloud automatically, because that spends the user's own API key without asking. Others covered a banner that mustn't ship and a failed reply that mustn't leave a blank bubble.

The gate commit added two steps to scripts/ios-release-check.sh. check-owner-rulings.sh greps the source for the wiring of three of the four rulings, for example that the local router is used instead of the default one. The fourth is left to UI testing on a device. ios-upgrade-install-gold-flow.sh builds the previous tagged version and the new one in Debug, installs the old one on a simulator, seeds a conversation through the UI, and installs the new build over the same container. Using fake AI responses, it then checks for a history entry, a visible user message and a new turn.

That second step is the mobile-specific one. Pausing distribution leaves any database changes the installed build already made, so I rehearse the upgrade before upload.

The release also depends on who verifies it. My rule is that no build goes to an internal track or TestFlight without an independent UI QA verdict for that exact commit, unless I explicitly waive it, and every verdict records an install proof: uninstall, fresh install, then dumpsys package on Android. That rule exists because one verdict was written against a stale, differently-signed install.

A mobile release checklist you can copy

  1. Gate in the lane, not the wrapper. Put pre-upload checks in each Fastlane lane (or Gradle task) that builds or uploads, so calling that lane directly still runs them.
  2. Icon and branding identity. Hash the icon set against a denylist of your sibling apps, and check the build compiles the set you hashed.
  3. Listing words. Scan your store listing files for other platforms' names, in every locale you ship.
  4. Legal links. Check that Terms and Privacy are referenced on the paywall and in Settings, then tap them on a real device.
  5. R8 audit at the deploy commit. Fail the deploy if code R8 can see changed after the audit.
  6. Version ledger. Bump the code in a commit, tag from main after a fast-forward pull, and check the highest code Play returns before you pick the next one.
  7. Signing. When a portal capability changes, regenerate the provisioning profile. In one Fastlane setup, match kept reusing the profile on disk until I forced regeneration (the GifPing iOS repo).
  8. Upgrade-install. Install the previous build, seed real data, install the new one over it, and assert that the specific record you seeded survives.
  9. Install proof. The QA verdict names the exact commit, from an uninstall and fresh install.
  10. Staged rollout on. For updates, start at a small percentage on Play and use phased release on iOS. Halting a Play staged rollout stops further delivery of that version and leaves existing installs in place. Pausing Apple's phased release still allows manual downloads.
  11. Fix forward. Plan the next release before you need it, because a bad binary already on a phone is replaced by a new build.
  12. Add the gate after every miss. Commit the check with the failure it came from in the message.

If you inherit an app whose releases don't look like this, my app rescue work starts with exactly this audit. For the surrounding branching and testing choices, see trunk-based development for mobile and my test automation layers.