[Android/Flutter] How to build your `aab` file as a production build?

Android

You just write down on the console

flutter build appbundle  --dart-define=FLAVOR=production --release --flavor production --build-number=4  --build-name=1.0.0

flutter build appbundle : If you want to export app as the type of app bundle you can use this command. If you want to export as apk you can use flutter build apk instead.

--dart-define=FLAVOR=production : --dart-define is something like environment variables in dart. I use some parameter separated by FLAVOR.

--release : You don't have to put the argument because it is selected as default. But if you want to build as profile or assemble you have to write it over as properly.

--flavor : It configures dart app flavor. Don't be confused of --dart-define=FLAVOR, which is just a environment variable.

--build-number : It defines the version of this application. build-number must be increamental or larger than previous one.

--build-name : You can name any names. But that has a convention of which --build-name should be named as semantic versioning

Happy Happy coding!

コメント

タイトルとURLをコピーしました