How do we reset build number to 1 with Xcode Cloud

Running into an issue where there seems to be no functional way to reset the build to 1 whenever we make a new version.

I've bumped up the patch version of the app, but there seems to be no way to reset the build to 1 when using Xcode cloud. Any attempts to do so in the Xcode Cloud settings portion of appstore connect are hit with a "The number entered must be greater than the latest Xcode Cloud build number".

But resetting to 1 will NEVER satisfy this requirement. The number will always be lower than the previous build number we used in Xcode cloud, because that was for a previous version.

Is this even possible?

Example: I want to go from 1.2.2 (501) to 1.2.3 (1) on an app already being managed by Xcode Cloud

Hello Tyler,

I would recommend starting with Setting the Next Build Number for Xcode Cloud Builds for an understanding of how build numbers impact your App Store Connect submissions.

—jasonag.

Hey there Jason, thanks. We distribute our iPhone, iPad, and Watch app on the iOS App Store, and the article suggests it should be possible to reset the build number to 1 while bumping the version number:

Apps for [iOS, watchOS] platforms can use a lower build number for a new version compared to a previous version because App Store Connect requires each app version to use a unique combination of CFBundleShortVersionStringand CFBundleVersion.

However, Mac apps must follow different build number requirements. To successfully submit a Mac app to app review, its build number must continuously increase, even across app versions.

The app is Apple Silicon Mac-compatible, and we do not opt out of distributing it on the Mac App Store as well. However, it does not have a Mac target (no Catalyst). Does that limit us from resetting the build number? If we hypothetically opted out of distributing on the Mac App Store, would resetting the build number work as expected?

Xcode Cloud treats build numbers as a single, monotonically increasing value across versions, which does not get "reset" for new versions. They are per-app, rather than per-version. So:

  • v1.0.0 — builds 1-10
  • v1.0.1 — builds 11-20
  • v1.1.0 — builds 21-25
  • v2.0.3 — builds 26-50

etc.

App Store Connect allows you to set a build number at which to start your first Xcode Cloud build (rather than starting that build at "1", as would be the default). This is to support existing apps and build numbers, so as to avoid build number conflicts and issues submitting "earlier" builds to App Store Connect.

It is not for "resetting" the build number to a value lower than the highest used build number.

I would encourage you to treat your build numbers as unique identifiers, so you know exactly which artifact is "build 42" (because there will only ever be one "build 42" in Xcode Cloud for your project).

—jasonag.

It's a shift from how we were doing things, but I see how it should work from now on. Thanks Jason.

We need an API call in appstoreconnectapi to set build number - since we have 2 bundles and want the build numbers to be coordinated.

Why do we have 2 bundles? Since we want STAGE to be testable in Testflight and PROD to be testable in Testflight. And we want to distinguish them and not get confused.

I successfully reset the build number by logging into AppStoreConnect and deleting the xCode Cloud data for the app. Afterward, I incremented the app version and established a new xCode Cloud workflow.

Important: When deleting xCode Cloud data, it's necessary to wait approximately half an hour before creating a new workflow. Attempting to do so immediately after deleting the data may result in xCode throwing errors.

How do we reset build number to 1 with Xcode Cloud
 
 
Q