← Nesim Apps

The iOS Build Number That Stayed at 1: Three Failed Fixes and One That Worked

By Nesim Razon, independent mobile developer · 2026-11-17

#Dev notes#iOS

Every upload to App Store Connect needs a build number higher than the one before it. Our cloud pipeline kept producing a package whose build number was 1, no matter what we changed. It took three attempts to find out why. This is the story and the fix, for anyone who builds iOS apps from a generated Xcode project without a Mac of their own.

The symptom

The upload step failed with an error saying the bundle version must be higher than the previously uploaded one. The first upload of an app always works, so the problem only shows from the second build on. The number shown for the build on the store side was 1 every time.

Two numbers are involved. The marketing version, such as 1.0, is what people see. The build number, CFBundleVersion, only has to increase with every upload of the same marketing version.

Attempt one: archive flags

The build tool has a way of passing extra flags to the archive command, so we passed the build number there. Nothing changed. The flag was accepted without any effect on the value that ended up in the package.

Attempt two: editing the project description

The project is generated by XcodeGen from a small description file, and that file has a field for the build number. We rewrote it with sed before generating the project, using the number of the CI run. The generated project did contain the new value, but the package still said 1.

The reason is that the Info.plist that XcodeGen produced does not take the build number from that setting. It has its own value, and that value is what gets packaged.

Attempt three and a better idea

A third variation of the same idea failed in the same way. The thing to change was not the build settings but the file that is actually read: the Info.plist.

The fix: write it into the Info.plist

After the project is generated, one command sets the value directly: PlistBuddy with Set :CFBundleVersion and the number. The number is 1000 plus the build counter of the CI service, so it always grows and never collides with the earlier uploads.

The second half of the fix is to prove it. Before uploading, the script reads CFBundleVersion back out of the finished package and prints it to the log. If the value is wrong, you see it in a minute instead of after a failed upload.

What to take away

Frequently asked questions

What is the difference between the version and the build number?

The version is the number users see, for example 1.0. The build number only needs to go up with every upload of that version.

Why did editing the project description not work?

The Info.plist generated by XcodeGen did not take the build number from that setting, so the package kept its own value.

How do you check the value that was packaged?

Read CFBundleVersion from the Info.plist inside the finished package and print it in the build log before uploading.

More from the blog