iTunes requires both Version Number (CFBundleShortVersionString) and Build Number (CFBundleVersion) to be incremented in order to make an update to an app.
My question is will the Bundle version value ever be reset when I increase the Version number?
For example, if I update from version 2.2.1 (Build Number 9.5) in the current store to version 2.3.0 (Build Number 1.0), will that be allowed? Or does the Build number have to be >= 9.6? What is the convention for Build number?
Does such relationship between Version Number and Build Number exist? It just doesn't make sense to me to keep track the old Build number from the previous release.
Click the Xcode Cloud tab and choose Settings in the sidebar. Click the Build Number tab below Settings. Click the Edit button next to Next Build Number. Enter a new build number and save your changes.
For uploading a new build, you need to create a new version on iTunes. After creating a new version you can submit it with your latest build & also update all the details which you desire & all those will be reviewed & made live once apple review those.
To see your macOS version and build numbers on a Mac, choose Apple > About This Mac and click the version number. In iOS or iPadOS, go to Settings > General > About and tap Software Version. For watchOS, in your iPhone's Watch app, go to General > About and look at the Version line.
In iOS, but NOT macOS, you can reset the Build Number(CFBundleVersion
) any time you update the Version Number (CFBundleShortVersionString
).
This is something that you need to do in your Xcode project. The version or build numbers are never automatically reset.
Apple Technical Note TN2420, Version Numbers and Build Numbers
iOS:
For iOS apps, build numbers must be unique within each release train, but they do not need to be unique across different release trains. That is to say, for iOS Apps you can use the same build numbers again in different release trains if you want to.
Mac OS:
However, for macOS apps, build numbers must monotonically increase even across different versions. In other words, for macOS apps you cannot use the same build numbers again in different release trains.
The build number is actually not visible for the user so it doesn't actually really matter what you put in there. Apple wants you to increase it, so just put a higher number in there ;) What build number usually is used for is to track your internal 'number' of builds you did. A lot of people use automatic build incrementors for that but more sophisticated companies manage it explicitly.
Since you don't seem to care about the build number, you can just use an automatic script and never look at it again. I use this script:
#!/bin/sh
plist="$1"
dir="$(dirname "$plist")"
buildnum=$(/usr/libexec/Plistbuddy -c "Print CFBundleVersion" "$plist")
IFS="."
save=""
out=""
for i in $buildnum
do
out=$out$save
save="$i."
done
A=($save)
save=${A[0]}
save=`expr $save + 1`
save=$(printf "%05d" $save)
out=$out$save
IFS="ABVVVV"
buildnum=$out
/usr/libexec/Plistbuddy -c "Set CFBundleVersion $buildnum" "$plist"
Copy paste the code into a file with '.sh'-extension on your file system, where you will never delete it (or into your project dir) and then go to your xcode project, on the left select your project name (open the project settings) click on the build target, go to the 'build phases'. Then a new build phase of type 'Run Script'
For 'Shell' insert /bin/sh
and in the code line below insert
#/bin/sh
/Users/..PutThePathToTheScriptYouSavedAboveHere.sh "${PROJECT_DIR}/${INFOPLIST_FILE}"
I am using build versions using X.XX.XXXXX the script will just increase the last number.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With