简体   繁体   中英

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?

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

在此处输入图片说明

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)
 )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM