Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increment build number using fastlane and jenkins for iOS CICD setup?

I am using fastlane and jenkins for my iOS CICD setup. I used a command increment_build_number in my fastfile in order to increment the build number for every internal deployment to crashlytics.

Initially it was incrementing the Bundle version in info.plist and not Bundle version string,short. In the middle, i changed the Bundle version string,short to 1.0.0 in Xcode in order to test whether this will change the Bundle version string,short to 1.0.1 during next deployment .

After this increment_build_number is not at all working and it is not incrementing either the Bundle version nor the Bundle version string,short.

I couldn't find what is the issue here. Are we not suppose to change any of the bundle version in Xcode manually and how to fix this again?

like image 935
yaali Avatar asked Dec 09 '25 17:12

yaali


1 Answers

Check the versioning settings in Xcode - Xcode -> Target -> Build Settings -> Search for Versioning

  • Change Versioning System to Apple Generic
  • Set Current Project Version to a version value you want to start For Example, Current Project Version = 1

enter image description here

In Fastlane script you can pick from below as per your requirement :

 increment_version_number # Automatically increment patch version number

 increment_version_number(
 bump_type: "patch" # Automatically increment patch version number
 )

 increment_version_number(
 bump_type: "minor" # Automatically increment minor version number
 )

 increment_version_number(
 bump_type: "major" # Automatically increment major version number
 )

 increment_version_number(
 version_number: "2.1.1" # Set a specific version number
 )

 increment_version_number(
 version_number: "2.1.1",      # specify specific version number (optional, 
 omitting it increments patch version number)
 xcodeproj: "./path/to/MyApp.xcodeproj"  # (optional, you must specify the 
 path to your main Xcode project if it is not in the project root directory)
 )
like image 58
Sumit Avatar answered Dec 11 '25 12:12

Sumit