'Prevent fast lane from checking App Store latest build number and increasing it

When I set a build number in my Xcode project lower than the latest uploaded build. Fastlane changes build number for the produced build and set it to latest+1. Even that I disabled managing build number from Xcode and didn't set any configuration for it in my lane.

platform :ios do
  desc "Push a new release build to the App Store"
  lane :release do |options|
    ENV["GYM_BUILDLOG_PATH"] = options[:xcode_build_path]
#increment_build_number(build_number: options[:build_number], xcodeproj: "xxxxxx")
    build_app(scheme: "xxxxxx", xcargs: "-allowProvisioningUpdates", archive_path: options[:archive_path], output_directory: options[:output_directory], suppress_xcode_output: true)
    upload_to_app_store(skip_metadata: true, skip_screenshots: true)
  end
end

If apple gonna reject that build becuase the build number is lower than latest build. I want fastlane to not fix it. want the fastlane command to fail.



Solution 1:[1]

You can configure your build_app script with the following manageAppVersionAndBuildNumber property:

build_app(scheme: "your_app_scheme", 
          export_options:{ 
            manageAppVersionAndBuildNumber: false 
          })

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Akif