log scripts

This commit is contained in:
niuhuan 2022-02-10 22:58:48 +08:00
parent 108a72d688
commit fab6604bb5
11 changed files with 52 additions and 3 deletions

View File

@ -1 +0,0 @@
gomobile bind -target=android/arm -o lib/Mobile.aar ./

View File

@ -1 +0,0 @@
gomobile bind -target=ios/arm64 -o lib/Mobile.xcframework ./

View File

@ -21,7 +21,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0
url_launcher_ios: 02f1989d4e14e998335b02b67a7590fa34f971af url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c

1
scripts/README.md Normal file
View File

@ -0,0 +1 @@
用于记录作者构建时使用的脚本

1
scripts/bind-ios.sh Normal file
View File

@ -0,0 +1 @@
gomobile bind -target=ios -o lib/Mobile.xcframework ./

6
scripts/build-apk-arm.sh Normal file
View File

@ -0,0 +1,6 @@
# 仅构建arm的APK
cd go/mobile
cd ../..
gomobile bind -target=android/arm -o lib/Mobile.aar ./
flutter build apk --target-platform android-arm

View File

@ -0,0 +1,6 @@
# 仅构建arm64的APK
cd go/mobile
gomobile bind -target=android/arm64 -o lib/Mobile.aar ./
cd ../..
flutter build apk --target-platform android-arm64

13
scripts/build-ipa.sh Normal file
View File

@ -0,0 +1,13 @@
# 构建未签名的IPA
cd go/mobile
gomobile bind -target=ios -o lib/Mobile.xcframework ./
cd ../..
flutter build ios --release --no-codesign
cd build
mkdir -p Payload
mv ios/iphoneos/Runner.app Payload
sh ../scripts/thin_payload.sh
zip -9 nosign.ipa -r Payload

24
scripts/thin-payload.sh Normal file
View File

@ -0,0 +1,24 @@
# 精简Payload文件夹 (上传到AppStore会自动区分平台, 此代码仅用于构建非签名ipa)
foreachThin(){
for file in $1/*
do
if test -f $file
then
mime=$(file --mime-type -b $file)
if [ "$mime" == 'application/x-mach-binary' ] || [ "${file##*.}"x = "dylib"x ]
then
echo thin $file
xcrun -sdk iphoneos lipo "$file" -thin arm64 -output "$file"
xcrun -sdk iphoneos bitcode_strip "$file" -r -o "$file"
strip -S -x "$file" -o "$file"
fi
fi
if test -d $file
then
foreachThin $file
fi
done
}
foreachThin ./Payload