forked from openjmu/OpenJMU
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_release_on_macos.sh
executable file
·49 lines (38 loc) · 1.02 KB
/
build_release_on_macos.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
flutter --version
# Define current time
curtime=$(date +%Y-%m-%d\ %H-%M-%S)
# Clean first
flutter clean
# Then run flutter pub get to generate new configuration.
flutter pub get
# Regenerate resources and routes.
fgen -o lib/constants/resources.dart --no-preview --no-watch
ff_route
# Build Android APK
flutter build apk --release
## Pod install
cd ios
pod install
cd ..
# Build iOS Runner.app
flutter build ios --release
cd build/ios/iphoneos/Runner.app/Frameworks
cd App.framework
xcrun bitcode_strip -r App -o App
cd ..
cd Flutter.framework
xcrun bitcode_strip -r Flutter -o Flutter
cd ../../../../../../
# Archive Runner.app
xcodebuild -workspace ios/Runner.xcworkspace \
-scheme Runner clean archive -configuration release \
-sdk iphoneos -archivePath build/ios/Runner.xcarchive \
-quiet
# Export IPA
xcodebuild -exportArchive -archivePath build/ios/Runner.xcarchive \
-exportOptionsPlist ExportOptions.plist \
-exportPath release/"Runner $curtime" \
-allowProvisioningUpdates \
-quiet
exit 0