If you have an existing upload in Testflight for an app, you have to increment either the Version number or the Build number (or both).
The Version number can be incremented automatically with increment_version_number (as you noted), but you should specify what to increment.
In your case (v2.4.1): the major version number is 2, the minor is 4, the patch is 1.
So you should add this snippet in the Fastfile before building/archiving the app:
increment_version_number(
bump_type: "patch"
)
However I would not recommend to set version numbers automatically because the app’s version number depends on what you provide in the update. If it’s just a bug fix release or performance optimisation then increment the last digit the patch. If you’ve added some cool new features, you should increment the minor version. If the update was like a rewrite from scratch, a full redesign or some breaking change introduced then I would increment the major number in the version. It’s not elegant to always increment the patch number because the version number has a meaning.
In the project I’m working on we used to bump the version numbers manually upon a release, but increment the Build numbers automatically with Fastlane.
Here is what we did:
1.) Enable Apple Generic Versioning in the project: (Project > Build Settings > Versioning > Versioning System: Apple Generic)
2.) Set base build number: (Project > Build Settings > Versioning > Current Project Version: 1)
3.) Add the following simple Ruby helper class to fastlane/utility folder:
changelog_helpers.rb:
class BuildNumberFactory
class << self
def make
`git rev-list HEAD --count`
end
end
end
4.) Add this line to the very first lines in Fastfile:
Dir.glob('./utility/*').each { |file| require file }
5.) Usage in FastFile:
lane :your_submit_testflight_lane do
increment_build_number build_number: BuildNumberFactory.make
# gym, pilot, other actions after setting the build number
end
This method assumes that you use Git for version control. Basically for each commit Fastlane can assign a specific build number. And since you upload apps with incrementing Build number, it won’t be a problem that Version number is not changing.
When you’re about to release an update for the app I would suggest to:
1.) Increment the Version number (e.x. 2.4.2) in a new commit, push it to remote
2.) Create a Git tag for that commit
3.) Run your Fastlane lane which uploads the builds to Testflight
With the above technic, developers will not have to update Info.plist Version number all the time when submitting daily test builds to Testflight.
You only have to increment the Version number when you release an update - you can’t avoid this anyway.
Hope it helps! :)