Xcode "Manage Version and Build Number" 选项

Xcode "Manage Version and Build Number" option

我刚刚更新到 Xcode 13 Beta,我将使用此版本 Xcode 将我的第一个构建上传到 App Store。此版本的 Xcode 显示了一个新的 App Store Connect 分发选项,这是我以前从未见过的:

Manage Version and Build Number

This will change the version and build number of all content in your app to 1.2 (3).

我在归档之前已经将我的版本和内部版本号从 Xcode 提高了。我们应该在这里做什么?如果它是一种自动化的构建增量方式,那么使用它有什么好处?

I have already increased my version and build number from Xcode before archiving. What should we do here?

如果您确定在存档之前已经更新了您的 version/build 号码,那么您可以取消选中此项,这将被忽略。

If it is an automated way of build increment, what are the benefits of using it?

  1. 它为您提供了更改 version/build 的机会,以防您忘记它。在以前的 Xcode 版本中没有这方面的指示。

  2. 它允许您在export/upload之前(归档后)更改version/build号码,之前您如果您想更改 version/build 编号,则必须创建一个新存档。

i 运行 这会带来意想不到的结果 - 它还会更改应用程序中嵌入的框架的版本号。

https://developer.apple.com/forums/thread/690647

对于使用 fastlane 并在 xcode 更改构建版本时遇到麻烦的人们。

Xcode 13 中的新内容:

When uploading an app to App Store Connect, the distribution assistant in Xcode detects whether your app has a valid build number (CFBundleVersion). If your app has an invalid number (like one that was used previously, or precedes your current build number), the distribution assistant provides an option to automatically increment it to a valid number. In addition, the distribution assistant ensures that the build numbers of all embedded content in your app (such as app extensions, App Clips, or watchOS apps) are in sync with your app. Note that this doesn’t modify your source code or your archive; Xcode updates the build number in a staged copy of your app before packaging and uploading it to App Store Connect. (59826409)

当使用fastlane构建和发布应用时,您可以将“manageAppVersionAndBuildNumbe: false”参数传递给export_options of build_app action来禁用xcode 版本变更。

build_app( scheme: "your_app_scheme", export_options:{ manageAppVersionAndBuildNumber: false })