我有一个脚本升级了我的版本(0.01 x 0.01)和我的构建(1 x 1)。它不再适用于 Xcode 11。
这是我的脚本:
#!/bin/bash
rm -rf build
Version=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "$INFOPLIST_FILE")
Version=$(echo "scale=2; $Version + 0.01" | bc)
Build=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
Build=$($Build + 1)
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $Build"
"$INFOPLIST_FILE"
if [ "${CONFIGURATION}" = "Release" ]; then
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $Version" "$INFOPLIST_FILE"
fi
这是我现在想在 Xcode 中构建或存档时出现的错误消息:
细节
未能安装请求的应用程序
域:NSPOSIXErrorDomain 代码:22
失败原因:应用程序的 Info.plist 不包含 CFBundleShortVersionString。
恢复建议:确保您的捆绑包包含 CFBundleShortVersionString。
用户信息:{
bundleURL = "file:///Users/olosta/Library/Developer/Xcode/DerivedData/Formbox-cxaxehrhmxqaqabbijmxvasgmhwn/Build/Products/Debug-iphonesimulator/Formbox_Renault_BusinessDays.app/";
}
我检查了那张票,但它对我的脚本没有帮助
如果我进入 Xcode/General/Identity,我可以看到 Xcode 中填写了“版本”和“构建”, 但是如果我通过手动打开它来检查我的 info.plist,这两个值都是空的
<key>CFBundleVersion</key> <string></string>
<key>CFBundleShortVersionString</key> <string></string>
如果我直接在 plist 中手动填充它们,它可以工作,但似乎 Xcode 中的值不再存储在该字段中?你怎么看?