Search code examples
xcodeazurefastlaneapple-tv

Azure Fastlane auto increment build number


I've been trying to auto-increment the build number of my tvos app through the app release step in my azure pipeline.

I followed this documentation to create this step.

- task: AppStoreRelease@1
inputs:
  serviceEndpoint: 'Test Connection to App Store'
  appIdentifier: ${{ parameters.appIdentifier }}
  appType: 'tvOS'
  ipaPath: '$(Build.ArtifactStagingDirectory)/${{ parameters.defaultArtifacts }}/build/*.ipa'
  releaseTrack: 'TestFlight'
  shouldSkipWaitingForProcessing: true
  shouldSkipSubmission: true
  fastlaneArguments: '--app_platform=appletvos --increment_build_number'
displayName: App Store Release

I want to use this fastlane argument to increment my build number, but I'm not sure how I would do that in the yml format. I've tried to add it as an additional argument like:

fastlaneArguments: '--app_platform=appletvos --increment_build_number'

But, It throws an invalid argument error. Looking for anyone having experience with such a scenario who would like to share the wisdom.


Solution

  • For anyone struggling with this in the future, I managed to update the build number by adding the following step in the pipeline before creating an archive or before Xcode build task.

    - script: fastlane run increment_build_number build_number:$(Build.BuildId) xcodeproj:Path_TO_PROJECT/app.xcodeproj
    displayName: Update Build Number
    

    Note: parameter xcodeproj is optional. if *.xcodeproj sub directory is located in your project root, you can ignore it.