Should I erase build number when uploading a new version? - ios

If for example, I have an app with the version of 1.0 and it has 30 builds (build 30 was uploaded to the App Store).
When I'll release version 1.0.1 should I erase the build number to 1? Or should it be 31?
Should it be 1.0.1 (1) or 1.0.1 (31)?

Technically for an iOS app the build number could start from 0 (or 1) again. For a Mac app that is not allowed. Wether you SHOULD do that is a different question.
Convention is that the build number always increments, also after a version number change.
See Apple's description of this:
https://developer.apple.com/library/content/technotes/tn2420/_index.html

From the ios docs
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). For iOS apps, you may re-use build numbers when submitting different versions. For macOS apps, you must chose a new build number for every submission that is unique and has never been used before in any submission you have provided to the App Store (including build numbers used in previous versions of your app).
So you can use 1.0.1 (1) or 1.0.1(31) but I would really prefer later one. I couldn't remember during my development remembering version number, we always refer build version within the team. And our build version is always greater than the previous build version.
You can ask why we follow this? The answer is because it looks logically right for us and also android versioning follows the same thing
From android docs
versionCode — An integer used as an internal version number. This number is used only to determine whether one version is more recent than another, with higher numbers indicating more recent versions. This is not the version number shown to users; that number is set by the versionName setting, below. The Android system uses the versionCode value to protect against downgrades by preventing users from installing an APK with a lower versionCode than the version currently installed on their device.

For an iOS app versioning the version would consist of 1.2.3, 1 being a major release, 2 being a minor release and 3 being the bug fixes. For every build version we can have as many builds as possible starting from any number. As per versioning standards we follow it from 1 whenever the version increases and build version always increases.

As others have mentioned, you should not reset the build number for new versions.
A method I often use is to add a script to the build phases of the target. That way, the build number continually updates without manual intervention.
In my case, I base the build number on the number of Git commits, but you can alter that to meet your needs.
REV=`git rev-list HEAD | wc -l`
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $REV" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"

Related

Can I release a bug fix for an already released ios version? Can I push a new version number before releasing the previous one?

Longish question for a potentially simple answer, but context might help provide an answer to the question I don't know to ask. :)
We have an app currently available on Android and PC that we are now pushing to ios. We are struggling to figure out how to make the app store versioning system fit with our existing system.
Our existing version number is of the format xx.yy.zz. When we start on a new release we increment yy and set zz to 0. I.e., if our last published version was 3.23.5, then we set the version number to 3.24.0. For each candidate build that we push to testing we increment the last number (so the next candidate would be 3.24.1).
So certainly we could make the ios version number be xx.yy and the build number zz.
But what happens when we need to push a quick patch for a release because we discover a bug? For our other platforms that would be, for example, 3.24.2. Can we release a build for version 3.24 to the app store after that version has already been made publicly available?
Alternately, we could make the version number be the whole xx.yy.zz number, and simply push new version numbers for each testing candidate even though previous versions have not been released. Is this a no-no?
If neither of these options is possible our trouble is we either have to make some process changes (so build numbers on other platforms bump up to 3.25 on a small patch, which we don't want to do) or we have to make the ios version numbers slightly different. E.g., 3.24 could be the initial release of a version and 3.24.1 could be the follow up (causing some discrepancy between version numbers across platforms and also some build machine pain since we'll need to detect whether the build is public or not yet).
Note, I have read this: https://developer.apple.com/library/content/technotes/tn2420/_index.html
The questions, in case you missed them:
Can we push a new build for a version number that is already on the app store (i.e., a patch of a released version)?
Can we push a build with a new version number when the previous version number is not yet released? If we did this as a standard practice would Steve Jobs rise from the grave and strangle us (and worse, would Apple ban us)?
iTunesConnct is not that flexible unfortunatlly. To your questions:
Can we push a new build for a version number that is already on the app store (i.e., a patch of a released version)?
No, once the version is ready for sale you cannot change the binary. You will need to create a new version.
Can we push a build with a new version number when the previous version number is not yet released? If we did this as a standard practice would Steve Jobs rise from the grave and strangle us (and worse, would Apple ban us)?
Not as far as I know. You will need to release the version in order to upload a new one (with a new version number). You cannot have more than one version pending release. If you try to click on the 'Add version' button while you already have version pending review/release - the button will be disabled. You can do that for different platforms - one build for iOs and one for tvOs.
Hope this helps.

Xcode build number for new version

Hope it's not off topic question. So usually I use my version for app:
1.0
1.1
1.2
So let's say I uploaded 50 builds to iTunes for the version 1.0
So it means that latest version of app has kind of 1.0.50 (indicating that the last build is 50)
So my question is should I bump build number for new version 1.1 to make it 1.1.1 or do I need to use 1.1.51 because previous build was 50.
Doest it make sense, is there any rules about it? I know that technically there is no worry about it, but if we say about some system and about team that usually want to check latest build or kind of maybe we should follow with some build number rules.
I use following:
AppName_<Major>.<Minor>.<Patch/Upgrade>.<BuildNo>
Major - Major version is a definite release of the product. It increased when there are significant changes in functionality.
Minor - Minor version is incremented when only new features or major bug fixes have been added.
Upgrade/Patch - Upgrade refers to the replacement of a product with a newer version of product.It is incremented only when upgrade is provided on designated major release.Patch version starts with 0 and incremented only when bug has been resolved.
Build No - Build Number is incremented when new build is created.

Set Marketing version in Xcode Plugin in Jenkins

I have installed XCode plugin on Jenkins and figured out how to do the versioning.
But my requirement is different. I have set marketing version as 00.001.${BUILD_NUMBER} . Let say its the 3rd build. It shows as 00.001.3 but what i need is 00.001.003. How can do this?
Similarly for Build Number 75 : it should be 00.001.075
And for build number 300 : it should be 00.001.300
To be more clear, what I want to know is how we can add leading zeros to the {BUILD_NUMBER} in Jenkins when setting the Marketing version.
Please answer if there is any solution available
Apple use to count build version as a number like for build version 00.001.3 . It take it as 000013 build version number. And for next build version the number must be greater than previous version. As you want to enter 00.001.003 i.e. 00001003 which is smaller than previous version i.e. 000013. So you cannot enter this build version.

Versioning of Xamarin iOS apps

I wanted to know how you deal with the versioning of your iOS apps. CFBundleShortVersionString should match with the version submitted to iTunes Connect and CFBundleVersion is your unofficial build number.
For CFBundleShortVersionString often the format {MajorVersion}.{MinorVersion}.{Revision} is used. One could use the {Build} number for the CFBundleVersion. Another possibility would be to use some sort of revision number from the VCS or in my case the SHA1 hash of the commit of GIT.
If you submit an app to the app store the CFBundleVersion is used to determine if your app is an update. It is only allowed to use digits and the dot separator here and it should be higher than the older version. So using a hash doesn't work here and there is no revision number in GIT. Once the app is ready for release the app can use the same value for CFBundleShortVersionString and CFBundleVersion if you have some different naming for the build number which is not compatible with the app store.
Currently the only thing which comes to my mind is to manually enter the version number if the app is ready for release. So you start counting if you have v. 1.0.0 and increases the number if you provide a new release. If you have a new beta version (e.g. you are planning a new release 2.0.0), what do you use for CFBundleVersion? Or what if you use continous integration and a new build is generated each day at midnight?
Also is there an automated process which connects Xamarin Studio, Info.plist and GIT so that for example the build number is increased on each commit? And how does such a process look like?
Bonus question: What information do you show the user in the about dialog of the app?
This is not full answer on how to handle inserting version into Info.plist and iOS versioning but instead how MonoDevelop/XamarinStudio creates version number from GIT commits. Which you can probably use to hack some way to update your Info.plist.
https://github.com/mono/monodevelop/tree/master/scripts
This folder has 3 files .sh and .bat are just to compile third file(.cs) and execute it.
So if you look into this .cs file you will see:
How to get "git.exe"
How to run blame on version.config(this is file where you manually insert versions like(5.5, 5.7, 5.8...)
How to run "rev-list --count " + hash + "..HEAD" which means count all commits between last change to version.config file and current commit. So if version.config was changed 143 commits ago, version will be 5.5.0.143, you can of course still use 3rd place for service packs.
And also some output of this informations like for example buildinfo which can then be used by other parts of build process to insert into Info.plist.
I hope this helps you to solve your problem.

App store Version number and build number

I had an app on app store with version 1.1.1 and build 85
While doing an update of the app using application loader the app I used version 1.2.0 and build 5.
It says that build version has to be higher than 85.
Is it that build number should always be incremental irrespective of version number.
If the version number is incremented as in our case can't we use a lower build number
Please point to some apple documentation on this.
Both build version numbers need to increment. They can be different numbers and different formats, but they both have to go up with each successive version you want to submit.
For each version number, e.g. (version 1), the build number will need to be incremented.
So the following is acceptable
Version 1; build 1
Version 1; build 2
Version 1; build 3
Version 1; build 4
... now, when you come to increase your version number, to say (version 2), you will be able to reset the build number back to say 1, if you want.
Version 2; build 1
Version 2; build 2
Version 2; build 3
Version 2; build 4
Just note that each new build number must be greater than the previous one.
Hope this helps someone else :-)
i had versioning problem for hotfix so I tested few cases.
and it can give you little more information, i think.
1.5.10(150) > 1.5.11(1) Failed.
xcode uploader said upload version should have larger number than 150. maybe my version has 2 period seperated version style.
1.5.10(150) > 1.5.11(180) obviously
1.5.11(180) > 1.5.11(1.5.11.1) Failed
1.5.11(160) > 1.5.11(160.1) has no problem.

Resources