Generate a keystore for the app to sign Android APKs:
cd android/
keytool -genkey -v -keystore keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload -storepass {PASSWORD HERE} -keypass {PASSWORD HERE} -dname "CN={Your Name}, OU={Your Unit}, O={Your Organization}, L={Your Location}, S={Your State}, C={Your Country}" To obtain SHA keys required for integrating Firebase:
cd android
./gradlew signingReport
cd ..Clean the Flutter project:
rm -rf ~/Library/Developer/Xcode/DerivedData
flutter cleanClean the project and fetch dependencies:
rm -rf ~/Library/Developer/Xcode/DerivedData
flutter clean
yes | flutter pub cache clean
flutter pub getClean the project and fetch dependencies for iOS:
rm -rf ~/Library/Developer/Xcode/DerivedData
flutter clean
yes | flutter pub cache clean
flutter pub get
cd ios/
pod init
pod install
pod updateTo build the Android application:
flutter clean
yes | flutter pub cache clean
flutter pub get
flutter build apk
mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/Customer.apk
open build/app/outputs/flutter-apk/To build the Android app bundle:
flutter clean
flutter pub get
flutter build appbundle
open build/app/outputs/bundle/release/Update iOS dependencies:
rm -rf ~/Library/Developer/Xcode/DerivedData
flutter clean
flutter pub get
cd ios
pod init
pod install
pod update
cd ..To publish the iOS app without changing the version:
rm -rf ~/Library/Developer/Xcode/DerivedData
cd ios
flutter clean
flutter pub get
pod init
pod install
pod update
xed .To publish the iOS app with a version change:
rm -rf ~/Library/Developer/Xcode/DerivedData
cd ios
flutter clean
flutter pub get
pod init
pod install
pod update
flutter build ios
xed .To resolve common iOS errors:
rm -rf ~/Library/Developer/Xcode/DerivedData
flutter clean
rm -rf ios/Pods
rm -rf ios/.symlinks
rm -rf ios/Flutter/Flutter.framework
rm -rf Flutter/Flutter.podspec
rm ios/podfile.lock
cd ios
pod deintegrate
flutter pub cache repair
flutter pub get
pod install
pod update
flutter build ios
pod install
pod update
xed .To clean old Firebase data and cache from the code:
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf .pub-cache/
rm -rf build
rm -rf firebase.json
rm -rf android/build
rm -rf .dart_tool/
rm -rf .idea
rm -rf android/.idea
rm -rf .metadata
rm -rf .flutter-plugins-dependencies
rm -rf .flutter-plugins
rm -rf devtools_options.yaml
rm -rf analysis_options.yaml
rm -rf android/app/google-services.json
rm -rf android/.gradle
rm -rf ios/.symlinks
rm -rf ios/Pods
rm -rf ios/Runner/GoogleService-Info.plist
rm -rf ios/firebase_app_id_file.json
rm -rf ios/build
rm -rf ios/Podfile.lock
rm -rf pubspec.lock
rm -rf lib/firebase_options.dartTo clean cache from the code:
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf .pub-cache/
rm -rf build
rm -rf android/build
rm -rf .dart_tool/
rm -rf .idea
rm -rf android/.idea
rm -rf .vscode/
rm -rf android/.gradle/
rm -rf ios/.symlinks/
rm -rf ios/Pods/
rm -rf ios/build/
rm -rf ios/Podfile.lock
rm -rf pubspec.lock
rm -rf devtools_options.yaml
rm -rf analysis_options.yaml
rm -rf .flutter-plugins
rm -rf .flutter-plugins-dependencies
rm -rf ios/Flutter/Flutter.podspec
rm -rf ios/Flutter/flutter_export_environment.sh
rm -rf ios/Flutter/Generated.xcconfig