I had setup fast lane and everything works fine and the app gets uploaded to test flight using the following fast file. I want to auto increment the build number based on the previous build number in TestFlight and upload new build with that incremented build number. Please advice how to do this
class Fastfile: LaneFile {
func customLane() {
let buildNumber = latestTestflightBuildNumber(appIdentifier: "com.softence.DemoApp", username: "[email protected]")
incrementBuildNumber(buildNumber: String(describing: buildNumber + 1))
buildIosApp(scheme: "DemoApp")
uploadToTestflight(username: "[email protected]", teamId: "39941891")
}
}
After execution it again asks to select the team from list of teams. I want to increment the build number and upload the build directly to test flight
I was trying to do the same thing, but could not find anything on how to achieve incrementing build number in the Swift Fastfile. However, I found a work around.
Note: I only wanted to increment build number and then push to TestFlight.
Work around:
fastlane run increment_build_numberto get increment the build number first.fastlane beta. This is only if your lane/function in the Fastfile is calledbetaLane(), change it accordingly. If it's calledhelloLane(), then usefastlane hello.And you're done!
However, that's two commands, let's make it into one (optional, but nice):
vim name_of_script.sh.fastlane run increment_build_number; fastlane beta;If you get this error:
Apple Generic Versioning is not enabled in this projectthen follow the directions here to enable it. It's really easy, just read it.After all this, you should be able to push to TestFlight with an incremented build number with just one command!