iOS DevOps Setup Guide for Swift Developers
DevOps Setup Plan for You
1. Fastlane - Automate Build & TestFlight Upload
2. Firebase Crashlytics - Catch Crashes in Production
3. GitHub Actions - CI/CD Pipeline: build + test
Step 1: Fastlane Setup
Prerequisites:
- Xcode already set up with your project
- Apple Developer Account connected
- GitHub or Bitbucket repo
Install Fastlane:
$ sudo gem install fastlane -NV
Inside your project:
$ cd YourAppFolder
$ fastlane init
Choose: 2. Automated beta distribution to TestFlight
Enter your Apple ID and App details
Sample Fastfile:
default_platform(:ios)
platform :ios do
desc "Push a new beta build to TestFlight"
lane :beta do
build_app(scheme: "YourAppSchemeName")
upload_to_testflight
end
end
Run:
$ fastlane beta
Step 2: Add Firebase Crashlytics
Add to Podfile:
pod 'Firebase/Crashlytics'
Then run:
$ pod install
In AppDelegate:
import FirebaseCore
import FirebaseCrashlytics
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey:
Any]?) -> Bool {
FirebaseApp.configure()
return true
}
}
Step 3: GitHub Actions CI/CD (Optional)
Create this file: .github/workflows/ios-build.yml
name: iOS CI
on:
push:
branches: [ main ]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
- name: Install dependencies
run: bundle install
- name: Build app
run: fastlane beta
Summary
- Fastlane: Build + TestFlight automation
- Crashlytics: Monitor real-time crashes
- GitHub Actions: Optional now, adds CI/CD