App Store 发布后,必须增加哪个 iOS 应用程序版本/内部版本号?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21125159/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Which iOS app version/build number(s) MUST be incremented upon App Store release?
提问by pkamb
Version/build fields for an iOS app include:
iOS 应用程序的版本/构建字段包括:
"Version" CFBundleShortVersionString(String - iOS, OS X) specifies the release version number of the bundle, which identifies a released iteration of the app. The release version number is a string comprised of three period-separated integers.
"Build" CFBundleVersion(String - iOS, OS X) specifies the build version number of the bundle, which identifies an iteration (released or unreleased) of the bundle. The build version number should be a string comprised of three non-negative, period-separated integers with the first integer being greater than zero. The string should only contain numeric (0-9) and period (.) characters. Leading zeros are truncated from each integer and will be ignored (that is, 1.02.3 is equivalent to 1.2.3). This key is not localizable.
"iTunes Connect Version Number": version number you specify when creating a new version of the app on iTunes Connect.
"Version" CFBundleShortVersionString(String - iOS, OS X) 指定包的发布版本号,它标识应用程序的发布迭代。发布版本号是一个由三个以句点分隔的整数组成的字符串。
"Build" CFBundleVersion(String - iOS, OS X) 指定包的构建版本号,它标识包的迭代(已发布或未发布)。构建版本号应该是一个字符串,由三个非负的、以句点分隔的整数组成,第一个整数大于零。该字符串应仅包含数字 (0-9) 和句点 (.) 字符。从每个整数中截断前导零并将被忽略(即,1.02.3 等效于 1.2.3)。此键不可本地化。
“iTunes Connect 版本号”:您在 iTunes Connect 上创建新版本应用程序时指定的版本号。
My question is:
我的问题是:
Which version/build numbers are required to be incrementedwhen a new version of the app is uploaded to iTunes Connect and/or released to the App Store?
当应用程序的新版本上传到 iTunes Connect 和/或发布到 App Store 时,需要增加哪些版本/内部版本号?
Can either "version" CFBundleShortVersionString
or "build" CFBundleVersion
remain the same between app updates?
应用程序更新之间的“版本”CFBundleShortVersionString
或“构建”是否可以CFBundleVersion
保持不变?
Extra points for Apple sources or the exact error messages iTunesConnect displays upon uploading an invalid version/build number.
Apple 来源的额外积分或 iTunesConnect 在上传无效版本/内部版本号时显示的确切错误消息。
Android / Google Play note:
Android / Google Play 注意:
The discussion prompting this question is that the public "version" of an Android app in the Google Play Store does notneed to be incremented and is in no wayvalidated. The android:versionName
can remain the same between releases, upgrade, downgrade, or be any random string rather than something that appears to be a valid "version number".
促使这个问题的讨论是,在谷歌的Android应用程序的公版“”玩不商店并不需要被递增,是没有办法验证。该android:versionName
可以保持相同的版本之间,升级,降级,或为任何随机字符串,而不是东西,似乎是一个有效的“版本号”。
android:versionName
— A string value that represents the release version of the application code, as it should be shown to users.The value is a string so that you can describe the application version as a
<major>.<minor>.<point>
string, or as any other typeof absolute or relative version identifier.
android:versionName
— 表示应用程序代码的发布版本的字符串值,因为它应该向用户显示。该值是一个字符串,以便您可以将应用程序版本描述为
<major>.<minor>.<point>
字符串,或任何其他类型的绝对或相对版本标识符。
Difference between versionName and versionNumber in Android
Android中versionName和versionNumber的区别
Whereas the android:versionCode
is enforced to be an incrementing-on-release integer.
而android:versionCode
强制为释放时递增的整数。
Apple documentation
苹果文档
As noted in the newly accepted answer, Apple has recently published a Technical Note that details their version and build number scheme:
正如新接受的答案中所述,Apple 最近发布了一份技术说明,详细说明了他们的版本和内部版本号方案:
Apple Technical Note TN2420 - Version Numbers and Build Numbers
回答by AechoLiu
Apple Technical Note TN2420, Version Numbers and Build Numbers
Summary:
概括:
- The pair (
Version
,Build number
) must be unique.- The sequence is valid: (1.0.1, 12) -> (1.0.1, 13) -> (1.0.2, 13) -> (1.0.2, 14) ...
Version
(CFBundleShortVersionString) must be in ascending sequential order.Build number
(CFBundleVersion) must be in ascending sequential order.
- 对 (
Version
,Build number
) 必须是唯一的。- 序列有效: (1.0.1, 12) -> (1.0.1, 13) -> (1.0.2, 13) -> (1.0.2, 14) ...
Version
( CFBundleShortVersionString) 必须按升序排列。Build number
( CFBundleVersion) 必须按升序排列。
Version Number and Build Number Checklist
Here are some things you can check when submitting a new build to the App Store. Making sure you have your Version Number and Build Number set properly will help you by avoiding having your App automatically rejected for having them improperly configured.
- For each new version of your App, you need to invent a new Version Number. This number should be a greater value than the last Version Number that you used. Though you may provide many builds for any particular release of your App, you only need to use one new Version Number for each new release of your App.
- You cannot re-use Version Numbers.
- For every new build you submit, you will need to invent a new Build Number whose value is greater than the last Build Number you used (for that same version).
- You can re-use Build Numbers in different release trains, but you cannot re-use Build Numbers within the same release train. For macOS apps, you cannot re-use build numbers in any release train.
版本号和内部版本号清单
以下是您在向 App Store 提交新版本时可以检查的一些事项。确保您正确设置了版本号和内部版本号将有助于避免您的应用程序因配置不当而被自动拒绝。
- 对于您的应用程序的每个新版本,您都需要创建一个新的版本号。此数字应大于您使用的最后一个版本号。尽管您可以为应用程序的任何特定版本提供多个版本,但您只需为应用程序的每个新版本使用一个新版本号。
- 您不能重复使用版本号。
- 对于您提交的每个新版本,您都需要创建一个新版本号,其值大于您使用的最后一个版本号(对于同一版本)。
- 您可以在不同版本系列中重复使用内部版本号,但不能在同一版本系列中重复使用内部版本号。对于 macOS 应用程序,您不能在任何版本系列中重复使用内部版本号。
Based on the checklist, the following (Version, Build Number)
sequence is valid too.
根据检查表,以下(Version, Build Number)
顺序也是有效的。
Case: reuse
Build Number
in different release trains. (NOTE: NOTmacOS app)(1.0.0, 1) -> (1.0.0, 2) -> ... -> (1.0.0, 11) -> (1.0.1, 1) -> (1.0.1, 2)
案例:
Build Number
在不同的发布系列中重用。(注意:不是macOS 应用程序)(1.0.0, 1) -> (1.0.0, 2) -> ... -> (1.0.0, 11) -> ( 1.0.1, 1) -> (1.0.1, 2)
回答by Andy
The CFBundleShortVersionString
should match the version number you give iTunes Connect. It is also the version number that appears when the user looks at your App in the App Store.
本CFBundleShortVersionString
应与你给iTunes Connect中的版本号。它也是用户在 App Store 中查看您的 App 时出现的版本号。
The version number is shown in the store and that version should match the version number you enter later in iTunes Connect.
版本号显示在商店中,该版本应与您稍后在 iTunes Connect 中输入的版本号相匹配。
The CFBundleVersion
is not displayed in the App Store, but is used by the iTunes to determine when your App has been updated.
该CFBundleVersion
不会在App Store中显示,但使用的iTunes来决定的程序进行了更新。
If you update the build string, as described in “Setting the Version Number and Build String,” iTunes recognizes that the build string changed and properly syncs the new iOS App Store Package to test devices.
如果您更新构建字符串,如“设置版本号和构建字符串”中所述,iTunes 会识别构建字符串已更改并将新的 iOS App Store 包正确同步到测试设备。
Answering your questions more specifically...
更具体地回答您的问题...
Which version/build numbers are required to be incremented when a new version of the app is uploaded to the app store?
当应用程序的新版本上传到应用程序商店时,需要增加哪些版本/内部版本号?
Both. One is displayed in the App Store, the other is used by iTunes to update the App.
两个都。一个显示在 App Store 中,另一个用于 iTunes 更新应用程序。
Can either CFBundleShortVersionString or CFBundleVersion remain the same between app updates?
CFBundleShortVersionString 或 CFBundleVersion 能否在应用更新之间保持不变?
No. (Meta question, what would the use case be here? If you've edited the payload in any way, the build will be different, and the user will want to know about it). If you try, you'll see error messages like below:
不。(元问题,这里的用例是什么?如果你以任何方式编辑了有效负载,构建将会不同,用户会想知道它)。如果您尝试,您将看到如下错误消息:
Or are they compared to the previous respective number to ensure that a numerically greater number is uploaded with the new version of the app?
或者它们是否与之前的相应数字进行比较,以确保使用新版本的应用程序上传更大的数字?
Yes. Using the semver.orgstandard.
是的。使用semver.org标准。
Are the CFBundleShortVersionString and CFBundleVersion numbers in any way compared to each other?
CFBundleShortVersionString 和 CFBundleVersion 数字是否以任何方式相互比较?
No.
不。
回答by Gabriel
CFBundleShortVersionStringis the public "name" of the version (example: "2.5", or "3.8.1"). You must increase it at each release.
CFBundleShortVersionString是版本的公共“名称”(例如:“2.5”或“3.8.1”)。您必须在每次发布时增加它。
CFBundleVersionis the private buildnumber. It is not seen on the AppStore. You must increase it at each upload. It means that if you ever reject a binary before it goes online, and you want to upload a new binary, it will have the same CFBundleShortVersionStringbut must have a higher CFBundleVersion(example: public "2.5", private "2.5", and then binary reject, and re-upload private "2.5.1")
CFBundleVersion是私有内部版本号。它在 AppStore 上看不到。您必须在每次上传时增加它。这意味着如果你在一个二进制文件上线之前拒绝了它,并且你想上传一个新的二进制文件,它将具有相同的CFBundleShortVersionString但必须具有更高的CFBundleVersion(例如:公共“2.5”,私有“2.5”,然后二进制拒绝,并重新上传私有“2.5.1”)
Edit on Nov 16, 2016:
2016 年 11 月 16 日编辑:
/!\ The CFBundleVersionproperty is also used (along with CFBundleName) in the User-Agent
header sent by NSURLConnectionin your code.
/ ! \ CFBundleVersion属性(与CFBundleName 一起)也用于代码中NSURLConnectionUser-Agent
发送的标头中。
Example: if CFBundleNameis MyAppand CFBundleVersionis 2.21, then any programmatic HTTP query sent directly by your code using NSURLConnectionwill embed the header:
示例:如果CFBundleName是MyApp并且CFBundleVersion是 2.21,那么您的代码使用NSURLConnection直接发送的任何编程 HTTP 查询都将嵌入标头:
User-Agent: MyApp/2.21 CFNetwork/... Darwin/...
User-Agent: MyApp/2.21 CFNetwork/... Darwin/...
(This does not apply to requests issued automatically by UIWebView).
(这不适用于 UIWebView 自动发出的请求)。
回答by xoail
CFBundleVersion and CFBundleShortVersionString must be greater than the app's last version number. It's a good practice to keep them same. You should find them in your -info.plist.
CFBundleVersion 和 CFBundleShortVersionString 必须大于应用程序的最后一个版本号。保持它们相同是一个很好的做法。您应该在您的 -info.plist 中找到它们。
When you try to validate the app in organizer it will throw an error if either of them has not been incremented. Happened to me last night.
当您尝试在管理器中验证应用程序时,如果它们中的任何一个未递增,它将引发错误。昨晚发生在我身上。
回答by pkamb
Both CFBundleVersion
and CFBundleShortVersionString
MUSTbe incremented when releasing a new version to the App Store.
无论CFBundleVersion
和CFBundleShortVersionString
必须发布新版本在App Store时递增。
Additionally, one of the strings must must match the version specified in iTunes Connect.
此外,其中一个字符串必须与 iTunes Connect 中指定的版本匹配。
This questionincludes the above screenshot of the Xcode Organizer's Validator refusing to validate the app when the CFBundleVersion
and CFBundleShortVersionString
have not been incremented.
这个问题包括 Xcode Organizer's Validator 在CFBundleVersion
和CFBundleShortVersionString
尚未递增时拒绝验证应用程序的上述屏幕截图。
This bundle is invalid. The value for key
CFBundleVersion
[1.0] in the Info.plist file must contain a higher version than that of the previously uploaded version [1.134].This bundle is invalid. The value for key
CFBundleShortVersionString
[1.0] in the Info.plist file must contain a higher version than that of the previously uploaded version [1.134].
此捆绑包无效。
CFBundleVersion
Info.plist 文件中key [1.0]的值必须包含比之前上传的版本 [1.134] 更高的版本。此捆绑包无效。
CFBundleShortVersionString
Info.plist 文件中key [1.0]的值必须包含比之前上传的版本 [1.134] 更高的版本。
The validator also throws an error proving that one of the strings must match the version of the app created on iTunes Connect.
验证器还会抛出错误,证明其中一个字符串必须与在 iTunes Connect 上创建的应用程序版本相匹配。
- Version Mismatch. Neither CFBundleVersion ['1.0'] nor CFBundleShortVersionString ['1.0'] in the Info.plist match the version of the app set in iTunes Connect ['1.4'].
- 版本不匹配。Info.plist 中的 CFBundleVersion ['1.0'] 和 CFBundleShortVersionString ['1.0'] 都不匹配 iTunes Connect ['1.4'] 中设置的应用程序版本。
回答by Steve Harris
The current Apple Technical Note TN2420, Version Numbers and Build Numberssays (my bolding):
当前的Apple Technical Note TN2420, Version Numbers and Build Numbers说(我的粗体):
- For iOS apps you can re-use build numbers in different release trains, but you cannot re-use build numbers within the same release train. For macOS apps, you cannot re-use build numbers in any release train.
- 对于 iOS 应用程序,您可以在不同版本系列中重复使用内部版本号,但不能在同一版本系列中重复使用内部版本号。对于 macOS 应用程序,您不能在任何版本系列中重复使用内部版本号。
Unfortunately, this means you can't reuse a build number that tracks to the release train number on iOS when you're trying to release the same build on Mac Catalyst.
不幸的是,这意味着当您尝试在 Mac Catalyst 上发布相同的构建版本时,您无法在 iOS 上重复使用跟踪发布序列号的构建编号。
In my case, for example, due to some earlier issues, I ended up releasing 1.0.2(4) as a Mac Catalyst app that corresponded to 1.0.2(1) on iOS. Now when trying to release 1.0.3(1) on both, the app fails verification on MacOS because of the build number, while it passes verification on iOS.
例如,就我而言,由于一些较早的问题,我最终将 1.0.2(4) 作为 Mac Catalyst 应用程序发布,对应于 iOS 上的 1.0.2(1)。现在,当尝试在两者上发布 1.0.3(1) 时,由于版本号,该应用程序在 MacOS 上验证失败,而在 iOS 上通过验证。
I guess now that I am releasing the same app on both iOS and MacOS routinely, I will adopt build numbers that correspond to the date, like 20200111 and increment with a decimal point if I need to change the build number within a given release.
我想现在我会定期在 iOS 和 MacOS 上发布相同的应用程序,我将采用与日期相对应的内部版本号,例如 20200111,如果我需要在给定版本中更改内部版本号,则使用小数点递增。
回答by arlomedia
I can confirm, having just tried it both ways, that a sequence of version and build numbers like...
我可以确认,刚刚尝试了两种方法,一系列版本和构建数字就像......
1.0.0 (1)
1.0.1 (1)
1.0.2 (1)
...will be accepted for iOS apps, but for Mac (Catalyst) apps it returns this error:
...将被 iOS 应用接受,但对于 Mac (Catalyst) 应用,它会返回此错误:
ERROR ITMS-90061: "This bundle is invalid. The value for key CFBundleVersion [1] in the Info.plist file must contain a higher version than that of the previously uploaded version [2]."
错误 ITMS-90061:“此包无效。Info.plist 文件中密钥 CFBundleVersion [1] 的值必须包含比先前上传的版本 [2] 更高的版本。”
The Mac version and build numbers would need to go like...
Mac 版本和版本号需要像......
1.0.0 (1)
1.0.1 (2)
1.0.2 (3)
For iOS, I used to enter build numbers as the version number plus a fourth digit, like...
对于 iOS,我曾经输入内部版本号作为版本号加上第四位数字,例如...
1.0.0 (1.0.0.1)
1.0.1 (1.0.1.1)
1.0.2 (1.0.2.1)
...but that isn't allowed for Mac apps, either. When I tried submitting my first Mac (Catalyst) app, Apple would only accept a build number with three or fewer digits:
...但 Mac 应用程序也不允许这样做。当我尝试提交我的第一个 Mac (Catalyst) 应用程序时,Apple 只接受包含三位数或更少位数的版本号:
ERROR ITMS-9000: "This bundle is invalid. The value for key CFBundleVersion [1.0.0.1] in the Info.plist file must be a period separated list of at most three non-negative integers."
错误 ITMS-9000:“此包无效。Info.plist 文件中键 CFBundleVersion [1.0.0.1] 的值必须是最多三个非负整数的句点分隔列表。”
So I changed to a single number that increments for every build and continues incrementing across version numbers.
所以我改成一个单一的数字,每次构建都会递增,并继续跨版本号递增。
回答by Yunus Nedim Mehel
You need to increment both.
您需要同时增加两者。
When uploading a new version, you will need to create a new version on the iTunes Connect, which automatically will be higher than the previous releases. This version on the iTunes Connect will be expecting a binary with the same version number, thus CFBundleShortVersionString
needs to be incremented.
上传新版本时,您需要在 iTunes Connect 上创建新版本,新版本会自动高于以前的版本。iTunes Connect 上的此版本CFBundleShortVersionString
需要具有相同版本号的二进制文件,因此需要递增。
If you update the version but forget to increment the CFBundleVersion
, you will encounter an error during the upload. See pkamb's answer and screenshot.
如果你更新了版本但忘记增加CFBundleVersion
,你会在上传过程中遇到错误。请参阅 pkamb 的答案和屏幕截图。
For details on CFBundleShortVersionString
and CFBundleVersion
, please see: https://stackoverflow.com/a/31921249/936957
有关详细信息CFBundleShortVersionString
,并CFBundleVersion
请参阅:https://stackoverflow.com/a/31921249/936957
回答by pkamb
I'm preparing to release a new Mac App Store app. Using CalVerformatting of YEAR.release (build)
.
我正准备发布一个新的 Mac App Store 应用程序。使用CalVer格式的YEAR.release (build)
.
I uploaded several builds: 2020.0 (1)
, 2020.0 (2)
, etc. I finally submitted 2020.0 (8)
for App Store Review. That passed review and is in the state Pending Developer Release.
我上传了几个版本:2020.0 (1)
,,2020.0 (2)
等等。我最终提交2020.0 (8)
了 App Store Review。已通过审核并处于Pending Developer Release状态。
I wanted to fix a few things before release, so I added a new build to the same release train: 2020.0 (9)
.
我想在发布前修复一些问题,所以我在同一个发布系列中添加了一个新版本:2020.0 (9)
.
That results in the error:
这导致错误:
App Store Connect Operation Error
ERROR ITMS-90062: "This bundle is invalid. The value for key
CFBundleShortVersionString
[2020.0] in the Info.plist file must contain a higher version than that of the previously approved version [2020.0]. Please find more information aboutCFBundleShortVersionString
at https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleshortversionstring"
App Store Connect 操作错误
错误 ITMS-90062:“此捆绑包无效
CFBundleShortVersionString
。Info.plist 文件中密钥[2020.0]的值必须包含比先前批准的版本 [2020.0] 更高的版本。请CFBundleShortVersionString
在https://找到更多信息developer.apple.com/documentation/bundleresources/information_property_list/cfbundleshortversionstring”
which is annoying as my 2020.0
version was never actually released. From the accepted answer of this question I was under the impression that until the app was available on the App Store you could continue to release new builds with the same version.
这很烦人,因为我的2020.0
版本从未真正发布过。从这个问题的公认答案中,我的印象是,在应用程序在 App Store 上可用之前,您可以继续发布具有相同版本的新版本。
- Error ITMS-90062: The value for key CFBundleShortVersionString must contain a higher version than that of the previously approved version
- Application Loader ERROR ITMS-90062: The value for key CFBundleShortVersionString must contain a higher version
- 错误 ITMS-90062:密钥 CFBundleShortVersionString 的值必须包含比先前批准的版本更高的版本
- 应用程序加载程序错误 ITMS-90062:密钥 CFBundleShortVersionString 的值必须包含更高版本
The solution seems to be that a "release train" (Same Version + New Build) cannot be updated if the app state is Pending Developer Release. Either release your existing build and then increase the version, or Cancel this Releasein App Store Connect to allow further uploads for this release train.
解决方案似乎是,如果应用程序状态为Pending Developer Release ,则无法更新“发布系列”(相同版本 + 新构建)。发布您现有的构建版本,然后增加版本,或者在 App Store Connect 中取消此发布以允许进一步上传此发布系列。
回答by SevenBits
AFAIK, off the top of my head, you only need to increment the build number CFBundleVersion
. Incrementing the short version string is not necessarily needed, though you probably should increment it, as it does tell the user that the app is new. Apple does say that numbering should follow traditional software versioning conventions, however, and iTunes Connect may complain if you try to re-upload an already existing version.
AFAIK,在我的脑海里,你只需要增加 build number CFBundleVersion
。不一定需要增加短版本字符串,但您可能应该增加它,因为它确实告诉用户该应用程序是新的。Apple 确实表示编号应遵循传统的软件版本约定,但是如果您尝试重新上传现有版本,iTunes Connect 可能会抱怨。
Long story short, it may work, but probably not.
长话短说,它可能会起作用,但可能不会。