Last active
December 29, 2023 16:55
-
-
Save ehbc221/c7727bd4b8281235dd0999046bfa4886 to your computer and use it in GitHub Desktop.
Flutter scripts for run, build, watch, rename and clean
This file contains hidden or 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
######################################## Run Flutter ######################################## | |
flutter run | |
######################################## Run the flutter build runner ######################################## | |
flutter pub run build_runner build --delete-conflicting-outputs | |
######################################## Watch changes in packages the flutter build runner ######################################## | |
flutter packages pub run build_runner watch --delete-conflicting-outputs | |
######################################## Sign APK (from project root) ######################################## | |
keytool -genkey -v -keystore myCustom-Keystore.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias custom | |
######################################## Verify Signature ######################################## | |
# Open APK Signer folder | |
cd ~/Library/Android/sdk/build-tools/30.0.2 || exit | |
# Run command | |
./apksigner verify -v --print-certs /Users/cisse028840/Projects/AndroidStudioProjects/expenza/build/app/outputs/flutter-apk/app-release.apk | |
######################################## Open SQLite in Android ######################################## | |
cd /Users/cisse028840/Library/Android/sdk/platform-tools || exit | |
./adb devices | |
./adb -s emulator-5554 shell | |
run-as com.example.expenza | |
cd databases/ || exit | |
sqlite3 expenza_database.db | |
######################################## Build APK ######################################## | |
# Run the abd installer with target APK | |
cd ~/Library/Android/sdk/platform-tools || exit | |
./adb install -r app-debug.apk | |
# From Project folder | |
# .~/Library/Android/sdk/platform-tools/adb install -r build/app/outputs/flutter-apk/app-release.apk | |
# From adb folder | |
# ./adb install -r ~/Projects/AndroidStudioProjects/expenza/build/app/outputs/flutter-apk/app-release.apk | |
######################################## Upload iOS version ######################################## | |
flutter clean \ | |
&& rm ios/Podfile.lock pubspec.lock \ | |
&& rm -rf ios/Pods ios/Runner.xcworkspace \ | |
&& flutter build ios --build-name=1.0.0 --build-number=1 --release --dart-define=MY_APP_ENV=prod | |
######################################## Build minified APK ######################################## | |
flutter build apk --target-platform android-arm --tree-shake-icons --analyze-size --split-per-abi --dart-define="env=prod" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment