Created
March 18, 2020 14:17
-
-
Save TechIsFun/97c0701616a2ee9409e2bea67aa5b09a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
################## | |
# https://github.com/microsoft/appcenter/blob/master/sample-build-scripts/flutter/android-build/appcenter-post-clone.sh | |
################## | |
cd .. | |
# fail if any command fails | |
set -e | |
# debug log | |
set -x | |
cd .. | |
git clone -b beta https://github.com/flutter/flutter.git | |
export PATH=`pwd`/flutter/bin:$PATH | |
flutter channel stable | |
flutter doctor | |
echo "Installed flutter to `pwd`/flutter" | |
# execute tests | |
flutter test | |
# build APK | |
flutter build apk --debug | |
# flutter build apk --release | |
# flutter build appbundle --target-platform android-arm,android-arm64,android-x64 | |
# if you need build bundle (AAB) in addition to your APK, uncomment line below and last line of this script. | |
#flutter build appbundle | |
# copy the APK where AppCenter will find it | |
mkdir -p android/app/build/outputs/apk/; mv build/app/outputs/apk/release/app-release.apk $_ | |
# copy the AAB where AppCenter will find it | |
#mkdir -p android/app/build/outputs/bundle/; mv build/app/outputs/bundle/release/app.aab $_ |
how would i have to modify. the script if the app has diferent flavors?
Try to add --flavor
flag to flutter build
command.
https://docs.flutter.dev/deployment/flavors
maybe i didnt ask properly, anyway, i found the proper way to do it, if any one else comes across this, heres how i did it
flutter build apk --release --flavor googlePlay
flutter build appbundle --release --flavor googlePlay
copy the APK where AppCenter will find it
mkdir -p android/app/build/outputs/apk/; mv build/app/outputs/flutter-apk/app-googleplay-release.apk $_
mkdir -p android/app/build/outputs/bundle/; mv build/app/outputs/bundle/googleplayRelease/app-googleplay-release.aab $_
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how would i have to modify. the script if the app has diferent flavors?