Building Android/iOS App:
Android:
If you want to build the app for Android, you can build APK by running flutter build apk
or APPBUNDLE by running flutter build appbundle
:
iOS:
If you want to build the app for iOS, run flutter build ipa
.
using MakeFile:
Makefile is a build automation tool that is used to automate the process of building executable programs and libraries from source code. It consists of a set of rules and dependencies that describe how to build the software. Flutter, on the other hand, is a popular mobile app development framework that is used to develop high-quality, performant mobile apps for iOS and Android.
Run Makefile command
make <command>
Makefile commands:
PHONY: clean format run_staging_sksl run_staging build_apk_staging build_apk_prod install_apk build_appbundle_staging build_appbundle_prod
clean:
@echo "╠ Cleaning the project..."
@rm -rf pubspec.lock
@flutter clean
@flutter pub get
@ cd ios && arch -x86_64 pod install
format: clean
@echo "╠ Formatting the code"
@dart format .
run_staging_sksl:
@echo "╠ Running staging with SkSl warmup"
@flutter run --profile --cache-sksl --purge-persistent-cache --dart-define=ENVIRONMENT=STAGING
run_staging: format
@echo "╠ Running app in STAGING mode"
@flutter run apk --dart-define=ENVIRONMENT=STAGING
build_apk_staging: format
@echo "╠ Building app in STAGING mode"
@flutter build apk --bundle-sksl-path flutter_01.sksl.json --dart-define=ENVIRONMENT=STAGING
build_apk_prod: format
@echo "╠ Building app in PRODUCTION mode"
@flutter build apk --bundle-sksl-path flutter_01.sksl.json --dart-define=ENVIRONMENT=PROD
install_apk:
@echo "╠ Installing apk..."
@flutter install build/app/outputs/flutter-apk/app-release.apk
build_appbundle_staging: format
@echo "╠ Building app in STAGING mode"
@flutter build appbundle --bundle-sksl-path flutter_01.sksl.json --dart-define=ENVIRONMENT=STAGING
build_appbundle_prod: format
@echo "╠ Building app in PRODUCTION mode"
@flutter build appbundle --bundle-sksl-path flutter_01.sksl.json --dart-define=ENVIRONMENT=PROD