Back to Blog

Automating Mobile Beta Deployment with Fastlane

BetaDrop Team
11 min read
automate beta deploymentfastlane tutorialcicd for mobilecontinuous delivery ios
How to Automate Beta Deployment with Fastlane

Manually archiving, signing, and uploading apps is a waste of developer time. In 2026, if you aren't automating your mobile release pipeline, you're doing it wrong.

This guide shows you how to use Fastlane to automate your beta deployment from "git push" to "ready for testers".

What is Fastlane?

Fastlane is a collection of tools (actions) that handle specific mobile development tasks. You define "lanes" (workflows) in a Fastfile (Ruby script).

Key Components

  • scan - Automates running tests.
  • match - Automates certificates and profiles (syncing them via Git/Cloud).
  • gym - Builds and archives your app (IPA/APK).
  • pilot - Uploads to TestFlight.
  • supply - Uploads metadata and binaries to Google Play.

Step 1: Installation

If you have Ruby installed:

gem install fastlane

Navigate to your project folder and run fastlane init.

Step 2: Defining a Beta Lane

Here is a typical Fastfile setup for distributing an iOS beta to TestFlight:

default_platform(:ios)

platform :ios do
  desc "Push a new beta build to TestFlight"
  lane :beta do
    # 1. Ensure clean git status
    ensure_git_status_clean

    # 2. Increment build number
    increment_build_number(xcodeproj: "MyApp.xcodeproj")

    # 3. Sync certificates (Codesigning)
    match(type: "appstore")

    # 4. Build the app
    gym(scheme: "MyApp")

    # 5. Upload to TestFlight
    pilot(skip_waiting_for_build_processing: true)
    
    # 6. Notify team on Slack
    slack(
      message: "New Beta Build Uploaded! 🚀",
      slack_url: "https://hooks.slack.com/..."
    )
  end
end

Alternative: Ad Hoc Distribution Lane

If you avoid TestFlight (e.g., using BetaDrop), you can swap pilot for a custom upload script or S3 upload.

lane :adhoc do
  match(type: "adhoc")
  gym(scheme: "MyApp", export_method: "ad-hoc")
  
  # Custom script to upload to BetaDrop or S3
  sh "curl -F 'file=@./MyApp.ipa' https://api.betadrop.com/upload"
end

Integrating with CI/CD

Fastlane runs seamlessly in CI. For GitHub Actions, your valid workflow file might look like this:

name: Deploy Beta
on:
  push:
    branches: [ main ]
jobs:
  build:
    runs-on: macos-latest
    steps:
      - uses: actions/checkout@v2
      - name: Run Fastlane
        run: fastlane beta
        env:
          MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
          APP_STORE_CONNECT_API_KEY: ${{ secrets.API_KEY }}

Summary

Fastlane transforms a 30-minute manual headache into a hands-off background process. Start simple with build automation, then add signing (Match) and deployment layers.

Ready to Distribute Your App?

Upload your IPA or APK file and get a shareable install link in seconds. No account required. Completely free.

Upload Your Build on BetaDrop
iMobile Designs
Developed by iMobile Designs
Made within India