Sparround

Build, flavours and release

Flutter has three build modes, and confusing them is a classic mistake:

  • debug — hot reload, assertions, no optimisation. Useless for measurement
  • profile — optimised, but with profiling tooling still available. This is where performance is measured
  • release — fully optimised, debug tooling off. This is what ships

Flavours let you build different product variants from one codebase: dev, staging, production. Each gets its own app name, icon, bundle id and API endpoint — which means all three can be installed side by side on one device, and that matters for testing.

ConcernAndroidiOS
Release artifactApp Bundle (`.aab`), recommended for the storeAn IPA archive
SigningA keystore plus `key.properties`, kept out of the repoA certificate plus a provisioning profile
Configuration`build.gradle` product flavoursXcode schemes and configurations
Size reduction`--split-per-abi` or App BundleThe App Store thins the app itself

Interview tip. On a release question, raise the security point yourself: signing keys and API secrets do not belong in the repo. On Android key.properties goes into .gitignore and is supplied as a CI secret; API keys are passed at build time with --dart-define. One nuance worth adding: a --dart-define value still ends up inside the binary — it suits configuration, not real secrets, which must stay on the backend.

📚 Sources and documentation