iOS TestFlight CI, automate the beta "waiting" process?

Sounds like Fastlane's pilot action is what you need:

The best way to manage your TestFlight testers and builds from your terminal

Based on the docs this would probably do what you need: generate the ipa you want to submit, then on the directory the iap is in run:

 fastlane pilot upload

It uploads the ipa in the current directory, waits the validation and distributes it to testers. There is also other commands to add or remove testers, and parameters to set the descriptions and stuff. You can check all the options with fastlane action pilot


Fastlane can take care of everything so if you want you can setup a lane that builds and submits the app to TestFlight with a Fastfile like this (you'll very have to tweak this to your project's specific needs):

  default_platform :ios

  platform :ios do

  desc "Submit a new Beta Build to Apple TestFlight"
  lane :beta do    
    #increment_build_number
    gym(scheme: "Your Scheme”) # Build your app - more options are available


    pilot # upload your app to TestFlight

    # You can do much more run `fastlane actions` to see all the actions
  end

Whenever you want a new build you can just run: fastlane beta.


Edit: How They Wait For It?

Using Spaceship to poll iTunes Connect (not nice API, they do web scraping on the pages) and check - in a loop every X seconds - if the processing is done.

Fastlane has a simpler action called watchbuild that its only job is to notify when processing is done. Check the source code for an example on how to use Spacechip: https://github.com/fastlane/watchbuild/blob/master/lib/watchbuild/runner.rb


  1. use fastlane tools to build & upload to ITC https://fastlane.tools

    • you have to invest a bit of time to learn docs and play with examples - but then it pays back!
    • fastlane pilot action is waiting for ITC validation by default
    • fastlane pilot action has an option to distribute_external - which also will make this TestFlight build available for external testers, if you need that
    • fastlane latest_testflight_build_number action can help you to automate build number increments for TestFlight builds.
  2. you can use fastlane with your CI, as all you need is to run a bash script launching fastlane lane

  3. you can also use this tool to make zillion of screenshots - if we talk about automation