Help center › CI/CD and automation

Ship to TestFlight with fastlane

Install fastlane and upload builds with an App Store Connect API key.

Install

fastlane recommends pinning it per project with Bundler. Create a Gemfile in your project with:

source "https://rubygems.org"
gem "fastlane"

then run bundle update, commit both Gemfile and Gemfile.lock, and run lanes with bundle exec fastlane …. Quicker alternative: brew install fastlane. Start with fastlane init in your project folder.

Upload to TestFlight with an API key

An App Store Connect API key avoids two-factor prompts on an unattended Mac. Create one in App Store Connect (Users and Access → Integrations), download the .p8 file to the Mac, and use it in a lane:

lane :beta do
  app_store_connect_api_key(
    key_id: "YOUR_KEY_ID",
    issuer_id: "YOUR_ISSUER_ID",
    key_filepath: "./AuthKey_YOUR_KEY_ID.p8"
  )
  build_app(scheme: "MyApp")
  upload_to_testflight
end

Run it with bundle exec fastlane beta, by hand or from your CI runner. Keep the .p8 file out of your repository.

Related

Use your Mac as a GitHub Actions runnerRegister a self-hosted runner and run it as a service so it survives reboots.Use your Mac as a GitLab RunnerInstall GitLab Runner for Apple silicon, register it with the shell executor and run it as a service.Code signing in CI buildsImport your signing certificate and provisioning profile into a temporary keychain for each job.

Still stuck?

Signed-in customers can message us from the portal; we reply within 24 hours on business days (AEST).