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.
| Concern | Android | iOS |
|---|---|---|
| Release artifact | App Bundle (`.aab`), recommended for the store | An IPA archive |
| Signing | A keystore plus `key.properties`, kept out of the repo | A certificate plus a provisioning profile |
| Configuration | `build.gradle` product flavours | Xcode schemes and configurations |
| Size reduction | `--split-per-abi` or App Bundle | The 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
- Build modesofficialdocs.flutter.dev
The official reference for how debug, profile and release differ and what each is for.
- Build and release for Androidofficialdocs.flutter.dev
- Build and release for iOSofficialdocs.flutter.dev
- Flavoursofficialdocs.flutter.dev