Basics
Running and Building
How to run app in different environments:
Environment name | Command |
---|---|
Default | flutter run OR flutter run --dart-define="environment=default" |
Development | flutter run --dart-define="environment=develop" |
Staging/ QA | flutter run --dart-define="environment=stage" |
Production | flutter run --dart-define="environment=production" |
How to build app?
Building app with different environments
Platform | Environment name | Command |
---|---|---|
Android | Default | flutter build apk OR flutter build apk --dart-define="environment=default" |
Android | Development | flutter build apk --dart-define="environment=develop" |
Android | Staging/ QA | flutter build apk --dart-define="environment=stage" |
Android | Production | flutter build apk --dart-define="environment=production" |
Android (appbundle) | Default | flutter build appbundle OR flutter build appbundle --dart-define="environment=default" |
Android (appbundle) | Development | flutter build appbundle --dart-define="environment=develop" |
Android (appbundle) | Staging/ QA | flutter build appbundle --dart-define="environment=stage" |
Android (appbundle) | Production | flutter build appbundle --dart-define="environment=production" |
Platform | Environment name | Command |
---|---|---|
iOS | Default | flutter build ipa OR flutter build ipa --dart-define="environment=default" |
iOS | Development | flutter build ipa --dart-define="environment=develop" |
iOS | Staging/ QA | flutter build ipa --dart-define="environment=stage" |
iOS | Production | flutter build ipa --dart-define="environment=production" |
iOS (.app) | Default | flutter build ios OR flutter build ipa --dart-define="environment=default" |
iOS (.app) | Development | flutter build ios --dart-define="environment=develop" |
iOS (.app) | Staging/ QA | flutter build ios --dart-define="environment=stage" |
iOS (.app) | Production | flutter build ios --dart-define="environment=production" |
Building in different modes.
Pass additional arguments with your build commands.
mode | Command |
---|---|
Debug | flutter build ipa --debug , flutter build apk --debug |
Profile | flutter build ipa --profile , flutter build apk --profile |
Release | flutter build ipa --release , flutter build apk --release |
Building ipa without signing it
flag | command |
---|---|
--no-codesign | flutter 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.