gpt4 book ai didi

ios - 使用 CodeMagic 部署时如何增加 Flutter IOS 应用程序的内部版本号

转载 作者:IT老高 更新时间:2023-10-28 12:44:51 29 4
gpt4 key购买 nike

当我使用 Nevercode 拥有的 CodeMagic (https://codemagic.io/) 部署 Flutter 应用程序时,我无法自动增加它的内部版本号。

我按照本页所述的步骤进行操作:https://developer.nevercode.io/docs/incrementing-ios-app-version .

他们建议的脚本是这样的:

DSYM_INFO_PLIST="${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist"
buildNumber=$NEVERCODE_BUILD_NUMBER
stringLength=${#buildNumber}

if [ $stringLength -ne 0 ]; then
echo "Updating build number to $buildNumber"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
if [ -f "$DSYM_INFO_PLIST" ]; then
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $BUILD_NUMBER" "$DSYM_INFO_PLIST"
fi
else
echo "Missing build number, skip updating"
fi

在 Xcode 中添加此脚本后,我收到此错误:

Running pod install...                                             34.3s
Running Xcode build...
├─Assembling Flutter resources... 6.1s
└─Compiling, linking and signing... 6.9s
Xcode build done. 30.3s
Failed to build iOS app
Error output from Xcode build:

** BUILD FAILED **


Xcode's output:

=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
/Users/macbook/Library/Developer/Xcode/DerivedData/Runner-hdgyskbygbvchfagqudvhwidlraa/Build/Intermediates.noindex/Runner.build/Debug-iphoneos/Runner.build/Script-3590602C2
2484D000061C91A.sh: line 15: syntax error: unexpected end of file
Command /bin/sh failed with exit code 2

Could not build the precompiled application for the device.

在使用 Codemagic 进行部署时,有人可以说明如何正确增加 IOS 应用的内部版本号吗?它应该是在 Xcode 的构建阶段运行的脚本,还是添加到 Codemagic 工作流程的构建步骤中的命令?

理想情况下,当我使用 flutter run 运行应用程序时,它不应该增加,而是当我将它部署到 App Store Connect 时。

最佳答案

来自 Codemagic documentation他们向您展示了几个选项:

Here are some examples of the build arguments you can use to increment the app version. You can enter the build arguments in App settings > Build > Build arguments.

--build-name=2.0.$BUILD_NUMBER --build-number=$(($BUILD_NUMBER + 100))

--build-name=1.0.0 --build-number=$BUILD_NUMBER

--build-number=$(git rev-list HEAD --count)

在此处添加:

enter image description here

Please note that the number of builds in BUILD_NUMBER is counted separately for each workflow.

关于ios - 使用 CodeMagic 部署时如何增加 Flutter IOS 应用程序的内部版本号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55330105/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com