【问题标题】:Version and Build numbers not showing up while archiving the build in Xcode在 Xcode 中归档构建时版本和内部版本号未显示
【发布时间】:2017-07-18 05:12:24
【问题描述】:

我正在归档要提交到 App Store 的构建,但版本和构建没有显示。我附上了相同的屏幕截图。当我通过 Application Loader 提交应用程序时导出 .ipa 后,我收到此错误。 “包中的 Info.plist 必须包含 CFBundleShortVersionString 键。”我已经将这些详细信息添加到 info.plist 文件中,如下所示。

<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1.1</string>

info.plist 文件也在根文件夹中。我对 iPhone 和 iPad 应用程序有两个单独的目标。

【问题讨论】:

  • 您在构建时是否连接了设备?
  • 检查你的项目设置,目标是如何给出的
  • @KKRocks 是的,我已经附加了归档构建的真实设备。
  • @Sivajee Battina 是的,那里也一样。
  • 然后将其从 mac 中删除,然后使用 command + shift + k ...清理您的项目,然后再次使用通用设备构建。

标签: ios xcode app-store app-store-connect


【解决方案1】:

我找到了一个脚本如下。

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

删除此脚本后,我能够解决问题。此脚本用于自动更新版本和内部版本号。我不知道为什么这个脚本会导致问题。

【讨论】:

    猜你喜欢
    • 2022-11-08
    • 2023-02-01
    • 2015-10-06
    • 2014-09-30
    • 1970-01-01
    • 2021-09-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多