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

7k Views Asked by At

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.

3

There are 3 best solutions below

3
On BEST ANSWER

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.

3
On
optional_changelog = %Q{
  Your changelog
}

upload_to_testflight(
    ...
    changelog: optional_changelog,
    distribute_external: true,
    distribute_only: true, // false if you want to upload ipa
    groups: [
        "Your group",
        "Your other group"
    ],
    skip_submission: false, // defaults to false if not specified
    skip_waiting_for_build_processing: false, // defaults to false if not specified
)
0
On

FTR I was having issues uploading to a external group and the issue is that skip_waiting_for_build_processing needs to be set to false.

So ensure that you have the follow params set

 distribute_external: true,
 groups: ['Name of your group'],
 skip_submission: true,
 notify_external_testers: true,
 skip_waiting_for_build_processing: false,

https://docs.fastlane.tools/actions/testflight/#Parameters