Search code examples
fastlaneapp-store-connectfastlane-pilot

How do I distribute a build to external testers via Fastlane?


I have a Fastfile that performs the uploadToTestFlight action:

uploadToTestflight(
  username: "[email protected]",
  skipWaitingForBuildProcessing: false,
  distributeExternal: true)

This succeeded when I ran it. However, it didn't actually distribute the build to anyone. When I look at the build on App Store Connect > My Apps > Foo App > TestFlight > iOS, it says "Approved" near the build name, which implies that it already went through the review process.

However, when I click on the build, I notice that the only groups or users to which it was released to is App Store Connect Users, meaning it wasn't actually externally released.

I have a group named Foo Group which I would like to release it to whenever I run fastlane. How do I do that?

I tried resolving via the documentation for Pilot but it doesn't have an example with distributing externally.


Solution

  • In the Fastlane repo on GitHub, I found this code in pilot/lib/pilot/build_manager.rb

    if options[:distribute_external] && options[:groups].nil?
      # Legacy Spaceship::TestFlight API used to have a `default_external_group` that would automatically
      # get selected but this no longer exists with Spaceship::ConnectAPI
      UI.user_error!("You must specify at least one group using the `:groups` option to distribute externally")
    end
    

    My guess is that you didn't notice this silent warning in the output of your Fastlane run. Did you specify the groups parameter?

    Also it's worth to specify the changelog param if you're doing the external releases fully automatically.