Basics

Running and Building

How to run app in different environments:

Environment nameCommand
Defaultflutter run OR flutter run --dart-define="environment=default"
Developmentflutter run --dart-define="environment=develop"
Staging/ QAflutter run --dart-define="environment=stage"
Productionflutter run --dart-define="environment=production"

How to build app?

Building app with different environments

PlatformEnvironment nameCommand
AndroidDefaultflutter build apk OR flutter build apk --dart-define="environment=default"
AndroidDevelopmentflutter build apk --dart-define="environment=develop"
AndroidStaging/ QAflutter build apk --dart-define="environment=stage"
AndroidProductionflutter build apk --dart-define="environment=production"
Android (appbundle)Defaultflutter build appbundle OR flutter build appbundle --dart-define="environment=default"
Android (appbundle)Developmentflutter build appbundle --dart-define="environment=develop"
Android (appbundle)Staging/ QAflutter build appbundle --dart-define="environment=stage"
Android (appbundle)Productionflutter build appbundle --dart-define="environment=production"
PlatformEnvironment nameCommand
iOSDefaultflutter build ipa OR flutter build ipa --dart-define="environment=default"
iOSDevelopmentflutter build ipa --dart-define="environment=develop"
iOSStaging/ QAflutter build ipa --dart-define="environment=stage"
iOSProductionflutter build ipa --dart-define="environment=production"
iOS (.app)Defaultflutter build ios OR flutter build ipa --dart-define="environment=default"
iOS (.app)Developmentflutter build ios --dart-define="environment=develop"
iOS (.app)Staging/ QAflutter build ios --dart-define="environment=stage"
iOS (.app)Productionflutter build ios --dart-define="environment=production"

Building in different modes.

Pass additional arguments with your build commands.

modeCommand
Debugflutter build ipa --debug, flutter build apk --debug
Profileflutter build ipa --profile, flutter build apk --profile
Releaseflutter build ipa --release, flutter build apk --release

Building ipa without signing it

flagcommand
--no-codesignflutter build ipa --no-codesign, flutter build ios --no-codesign

Note: building for ipa will give Runner.xcarchive. To check the app, you should right click on Runner.xcarchive > then select show package contents > then open products > application > There you will be able to find the application.


Copyright © 2024