我无法更改项目的版本。 我尝试使用 Target->General->[Version and Build]
更改版本此外,我尝试更改 AppName-info.plist 中的版本
但是,当我存档这个项目时,我得到了错误版本的构建
当我尝试提交到 Appstore 时,出现此错误
如何解决?我们将不胜感激!
最佳答案
我解决了我的问题。 在“目标”->“构建阶段”中我找到了脚本
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
然后我就把它删除了。
关于ios - Xcode:无法更改项目版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32739604/