Which iOS app version/build number(s) MUST be incremented upon App Store release?

114,473

Solution 1

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 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.

  1. 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.
  2. You cannot re-use Version Numbers.
  3. 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).
  4. 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.

Based on the checklist, the following (Version, Build Number) sequence is valid too.

  • Case: reuse Build Number in different release trains. (NOTE: NOT macOS app)

    (1.0.0, 1) -> (1.0.0, 2) -> ... -> (1.0.0, 11) -> (1.0.1, 1) -> (1.0.1, 2)

Solution 2

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.

The version number is shown in the store and that version should match the version number you enter later in iTunes Connect.

Source

The CFBundleVersion is not displayed in the App Store, but is used by the iTunes to determine when your App has been updated.

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.

Source

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.

Can either CFBundleShortVersionString or CFBundleVersion remain the same between app updates?

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:

Error messages

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.org standard.

Are the CFBundleShortVersionString and CFBundleVersion numbers in any way compared to each other?

No.

Solution 3

CFBundleShortVersionString is the public "name" of the version (example: "2.5", or "3.8.1"). You must increase it at each release.

CFBundleVersion is the private build number. 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 CFBundleShortVersionString but must have a higher CFBundleVersion (example: public "2.5", private "2.5", and then binary reject, and re-upload private "2.5.1")

Edit on Nov 16, 2016:

/!\ The CFBundleVersion property is also used (along with CFBundleName) in the User-Agent header sent by NSURLConnection in your code.

Example: if CFBundleName is MyApp and CFBundleVersion is 2.21, then any programmatic HTTP query sent directly by your code using NSURLConnection will embed the header:

User-Agent: MyApp/2.21 CFNetwork/... Darwin/...

(This does not apply to requests issued automatically by UIWebView).

Solution 4

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.

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.

Solution 5

Both CFBundleVersion and CFBundleShortVersionString MUST be incremented when releasing a new version to the App Store.

Additionally, one of the strings must must match the version specified in iTunes Connect.

Xcode Organizer Validator error: must increment the version number.

This question includes the above screenshot of the Xcode Organizer's Validator refusing to validate the app when the CFBundleVersion and CFBundleShortVersionString have not been incremented.

  • 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].

The validator also throws an error proving that one of the strings must match the version of the app created on 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'].
Share:
114,473
pkamb
Author by

pkamb

Mac / iOS engineer

Updated on March 30, 2020

Comments

  • pkamb
    pkamb about 4 years

    Version/build fields for an iOS app include:

    • "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.

    My question is:

    Which version/build numbers are required to be incremented when a new version of the app is uploaded to iTunes Connect and/or released to the App Store?

    Can either "version" CFBundleShortVersionString or "build" CFBundleVersion remain the same between app updates?

    Extra points for Apple sources or the exact error messages iTunesConnect displays upon uploading an invalid version/build number.


    Android / Google Play note:

    The discussion prompting this question is that the public "version" of an Android app in the Google Play Store does not need to be incremented and is in no way validated. 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: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 type of absolute or relative version identifier.

    Difference between versionName and versionNumber in Android

    Whereas the android:versionCode is enforced to be an incrementing-on-release integer.


    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 Technical Note TN2420 - Version Numbers and Build Numbers

  • pkamb
    pkamb over 10 years
    I mentioned both of those keys in my question. Is your answer here that both of those values must be incremented? Can you better support your answer?
  • xoail
    xoail over 10 years
    Yes both needs to be incremented. Last night when I tried to submit before increment them, it complained for both the keys.
  • pkamb
    pkamb over 10 years
    Looking for authoritative answers on which keys must be incremented. If CFBundleShortVersionString is not required to be incremented, the "same" user-facing version can then be uploaded to the App Store multiple times?
  • pkamb
    pkamb over 10 years
    Right, I know how the two numbers are used. The question is: are both of them required to be incremented when releasing a new version of the app?
  • pkamb
    pkamb over 10 years
    Thanks for the additional info. You should edit your answer to add your experience when uploading a build.
  • Andy
    Andy over 10 years
    Yes, if you try to push an App into the App Store without updating both, you will see an error message e.g. stackoverflow.com/questions/19367893/…
  • Andy
    Andy over 10 years
    "It's a good practice to keep them same" - this isn't necessarily true. If you have testers working on your App, you might like to increment your build number as changes are applied, but keep your version number the same. Using continuous integration, you can have it update your build number for you before deploying to testers, for example.
  • pkamb
    pkamb over 10 years
    Thanks, great edit. Especially for that link. The organizer's validator is showing "must contain a higher version" errors for both CFBundleVersion and CFBundleShortVersionString.
  • xoail
    xoail over 10 years
    @Andy you're right, makes sense. Thanks for pointing out the use case. I was only thinking in terms of a single developer/tester environment.
  • jeet.chanchawat
    jeet.chanchawat almost 10 years
    +1 for SemVer link... Given a version number MAJOR.MINOR.PATCH, increment the: MAJOR version when you make incompatible API changes, MINOR version when you add functionality in a backwards-compatible manner, and PATCH version when you make backwards-compatible bug fixes.
  • pkamb
    pkamb over 9 years
    Great distinction between requirements for upload/release.
  • Néstor
    Néstor over 9 years
    @gabriel, I've tried to set the build number to X.X-rc2 but the Organizer validator doesn't allow me to set anything different from X.Y.Z where X,Y and Z are integer :S . It would be great to have a -rc2 build number, have you ever been able to submit one release with it?
  • Gabriel
    Gabriel over 9 years
    @nestor You're right, I was wrong. Only numbers are allowed. Let me edit my answer.
  • Tony Adams
    Tony Adams almost 9 years
    It may be good practice to keep them the same, but if you do, and if you use Apple's TestFlight, you'll find that each build will require a beta review before you can release it for External beta testing. That review is much quicker than App Store review, but still can take up to a day or so. Also, there is a limit of two beta reviews per day which can be a major bottleneck.
  • AechoLiu
    AechoLiu over 7 years
    @gabriel, I use a script to parse X.X-rc2 to X.X.2, for CI system to generate the buildNumber for uploading to iTunesConnect.
  • Emil
    Emil about 6 years
    I'm confused. One of the conditions is "You cannot re-use Version Numbers," but in the last example, version numbers are staying the same while build numbers are increasing. Am I misinterpreting something?
  • AechoLiu
    AechoLiu about 6 years
    @Emil, I think that it's (Version, Build Number) pair cannot be reused.
  • pkamb
    pkamb about 6 years
    @EmilParikh Version numbers can be uploaded to Apple multiples times prior to release, each with a unique Build number. But once it has been released, you cannot reused that Version number.
  • el_tigro
    el_tigro almost 6 years
    TN2420 says "Version numbers and build numbers may have up to three components separated by periods" and then provides the following illegal example 1.10000.1.5. However it looks like many apps, including chrome use a version number that contains 4 components (e.g. 68.0.3440.83). I guess this could be explained by the fact that the TN2420 page mentions "Important: This document is no longer being updated." however I haven't been able to find an updated doc that defines the new rules. Anyone else confused?
  • AechoLiu
    AechoLiu almost 6 years
    @catanman I like this Semantic Version. Let version be composed with (major, minor, patch) manner. And I had used 4 components before, but App store doesn't accept that format with 4 components.
  • el_tigro
    el_tigro almost 6 years
    @AechoLiu I use semver as well. It's great. Any idea why chrome is able to submit an app version with 4 components.(e.g. 68.0.3440.83)?
  • AechoLiu
    AechoLiu almost 6 years
    @catanman, I google and find this. It's 4 digit composed with MAJOR.MINOR.BUILD.PATCH. And iOS separate the BUILD_NUMBER as a solo property. Hope this help you.
  • el_tigro
    el_tigro almost 6 years
    @AechoLiu, thank you that helps. I guess the limitation of 3 components that is specified in TN2420 no longer applies. Do you agree?
  • AechoLiu
    AechoLiu almost 6 years
    I am using 3 components in Version, and 2 components in Build number. Sometimes I will extends Build Number with 3 components. I integrate them in Jenkins script. And our team accept the MAJOR.MINOR.PATCH way to define version number.
  • testing
    testing almost 5 years
    Regarding this: 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. My use case is that my app was successful reviewed by Apple, but never released before in the App Store. I found an error and I want to bugfix it - without changing CFBundleShortVersionString. Is this possible? I want to reject my own app.
  • Sazzad Hissain Khan
    Sazzad Hissain Khan over 4 years
    with the format MAJOR.MINOR.BUILD.PATCH can a BUILD number be allzero i.e. 0000 ?
  • pkamb
    pkamb about 4 years
    Do you have any of the error messages it gave you? Please quote them if so!
  • benc
    benc over 3 years
    If it helps with context, I worked on an app circa 2015, and I think we used the same build strategy you did, and it was allowed. When I was managing another app in about 2018, I got the errors you did, so I think the rules had changed to what you've described.
  • geohei
    geohei over 2 years
    By mistake, submitted two identical Version and Build number packages twice. App Connect increased the Build number of the second submit automatically by 1 by itself. Hence I ended up with 1.3 (50) being 1.3 (50) and the second 1.3 (50) becoming 1.3 (51). I didn't find any documentation, that in this particular case, App Connect increases the build number by itself, hence generating a mismatch between the entered Xcode build and the App Connect build. Is this a known/documented behavior?
  • O'Rooney
    O'Rooney almost 2 years
    "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." I think neither of these statements is true. You can use whatever you like for it, so long as it is increasing and unique, it's unrelated to the version number in App Store Connect. And it does not appear anywhere in iOS or the app store, unless you manually make it so.