版本和内部版本号在Xcode中存档时没有显示
问题描述:
我正在归档要提交给App Store的版本,但版本和内部版本未显示。我附上了相同的截图。在我通过Application Loader提交应用程序时导出.ipa后,出现此错误。 “包中的Info.plist必须包含CFBundleShortVersionString项。”我已经将这些详细信息添加到info.plist文件中,如下所示。版本和内部版本号在Xcode中存档时没有显示
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1.1</string>
info.plist文件也位于根文件夹中。 iPhone和iPad应用程序有两个单独的目标。
答
我发现一个脚本如下。
git=$(sh /etc/profile; which git)
git_release_version=$("$git" describe --tags --always --abbrev=0)
number_of_commits=$("$git" rev-list master | wc -l | tr -d ' ')
target_plist="$TARGET_BUILD_DIR/$INFOPLIST_PATH"
dsym_plist="$DWARF_DSYM_FOLDER_PATH/$DWARF_DSYM_FILE_NAME/Contents/Info
.plist"
for plist in "$target_plist" "$dsym_plist"; do
if [ -f "$plist" ]; then
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $number_of_commits"
"$plist"
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString
${git_release_version#*v}" "$plist"
fi
done
删除此脚本后,我能够解决问题。此脚本用于自动更新版本和内部版本号。我不知道为什么这个脚本是造成这个问题。
您是否在构建时附加了设备? – KKRocks
检查你的项目设置,目标是如何给出的 –
@KKRocks是的,我附加了真正的设备归档构建。 –