Die Oberfläche ist lokalisiert; Skill-Beschreibungen und -Dokumente werden per KI automatisch in Ihre Sprache übersetzt. Code, Befehle, Pfade und Fachbegriffe bleiben im Original, maßgeblich ist das Dokument des Autors.
Skills entdecken
Design und Kreativität · SKILL.md

mobile-ci-cd

mobile-ci-cd

Design, review, or troubleshoot CI/CD pipelines for mobile apps — build automation, code signing, test automation, artifact distribution, and release management across Flutter, Android, and iOS. Covers Fastlane, Codemagic, Bitrise, and GitHub Actions. TRIGGER when: user says /mobile-ci-cd, asks about mobile build automation, needs to set up code signing in …

Independent GitHub snapshot · Automated classification · Original documentation governs

Skill-Dokumentation

GitHub

name: mobile-ci-cd description: > Design, review, or troubleshoot CI/CD pipelines for mobile apps — build automation, code signing, test automation, artifact distribution, and release management across Flutter, Android, and iOS. Covers Fastlane, Codemagic, Bitrise, and GitHub Actions. TRIGGER when: user says /mobile-ci-cd, asks about mobile build automation, needs to set up code signing in CI, or wants to automate mobile app releases. argument-hint: "[mobile CI/CD pipeline to design or review]" user-invocable: true

Mobile CI/CD Pipeline Design & Review

You are a senior DevOps engineer specializing in mobile. Help the user design, review, or troubleshoot CI/CD pipelines for mobile app builds, testing, and distribution.

Process

Step 1: Gather Context

QuestionWhy It Matters
What platform? (Flutter, Android, iOS, or all)Determines build tooling and signing
What CI platform? (GitHub Actions, Bitrise, Codemagic, CircleCI, GitLab CI)Tool-specific configuration
What distribution? (Play Store, App Store, TestFlight, Firebase App Distribution)Release pipeline shape
What is the branching strategy?Trigger and environment mapping
Are there multiple flavors/variants? (dev, staging, production)Build matrix complexity
What is the current pain point? (slow builds, flaky signing, manual releases)Focus area

Step 2: Define Pipeline Stages

StagePurposeDurationPlatform
Checkout & SetupClone, restore caches, install SDK/dependencies1-3mAll
Lint & Static AnalysisCode style, type checking, static analysis1-3mAll
Unit TestsBusiness logic tests1-5mAll
Widget / Component TestsUI component tests (no device needed)2-5mAll
BuildCompile app, resolve signing, produce artifact3-10mAll
Integration TestsRun on emulator/simulator or device farm5-20mAll
Security ScanDependency audit, secrets detection1-3mAll
Distribute to TestersUpload to Firebase App Distribution / TestFlight1-3mAll
Store SubmissionUpload to Play Store / App Store Connect2-5mAll

Step 3: Configure Code Signing

Android

ComponentWhere to StoreHow to Access in CI
Keystore (.jks / .keystore)CI secrets (base64 encoded)Decode to file at build time
Key aliasCI environment variableKEY_ALIAS
Key passwordCI secretKEY_PASSWORD
Store passwordCI secretSTORE_PASSWORD
# Example: Decode keystore in CI
- name: Decode keystore
  run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > app/keystore.jks

Build variants:

debug    → no signing required
staging  → debug keystore or separate staging keystore
release  → production keystore, never committed to repo

iOS

ComponentWhere to StoreHow to Access in CI
Signing certificate (.p12)CI secrets or match (Fastlane)Decrypt at build time
Provisioning profilesCI secrets or match (Fastlane)Install to ~/Library/MobileDevice/
App Store Connect API keyCI secret (.p8 file)APP_STORE_CONNECT_API_KEY

Recommended: Use Fastlane Match

# Fastfile
lane :build_release do
  match(type: "appstore", readonly: true)
  build_app(scheme: "MyApp", export_method: "app-store")
end

Alternatives: Xcode Cloud (built-in signing), manual certificate management

Flutter

Flutter uses the platform-native signing for each target:

  • Android: Keystore-based (same as above)
  • iOS: Certificate + provisioning profile (same as above)
  • Signing config in android/app/build.gradle and Xcode project settings

Step 4: Optimize Build Performance

TechniqueImpactPlatform
Cache dependencies (pub, Gradle, CocoaPods, SPM)HighAll
Cache build artifacts (Gradle build cache, derived data)HighAndroid / iOS
Use incremental builds where possibleMediumAndroid / iOS
Parallelize test stagesMediumAll
Use hosted macOS runners (for iOS builds)RequirediOS
Pre-built Docker images with SDK pre-installedMediumAndroid / Flutter
Skip unchanged modules (in monorepos)HighAll
Use Fastlane for orchestrationMediumAll (reduces script complexity)

Caching examples:

# GitHub Actions — Flutter
- uses: actions/cache@v4
  with:
    path: |
      ~/.pub-cache
      build/
    key: flutter-${{ hashFiles('pubspec.lock') }}

# GitHub Actions — Gradle
- uses: actions/cache@v4
  with:
    path: |
      ~/.gradle/caches
      ~/.gradle/wrapper
    key: gradle-${{ hashFiles('**/*.gradle*', 'gradle.properties') }}

Step 5: Configure Distribution

ChannelToolWhen to Use
Internal testingFirebase App DistributionEvery PR merge or nightly — quick feedback loop
Beta testingTestFlight (iOS), Play Console Internal Testing (Android)Pre-release validation
Staged rolloutPlay Console (percentage rollout), App Store (phased release)Production releases
Ad-hoc / enterpriseDirect IPA/APK distributionInternal enterprise apps

Fastlane Lanes (Recommended)

# Fastfile — Flutter / Android / iOS
platform :android do
  lane :deploy_staging do
    gradle(task: "assembleStaging")
    firebase_app_distribution(
      app: ENV["FIREBASE_ANDROID_APP_ID"],
      groups: "internal-testers"
    )
  end

  lane :deploy_production do
    gradle(task: "bundleRelease")
    upload_to_play_store(track: "production", aab: "app-release.aab")
  end
end

platform :ios do
  lane :deploy_staging do
    match(type: "adhoc")
    build_app(scheme: "MyApp-Staging")
    firebase_app_distribution(
      app: ENV["FIREBASE_IOS_APP_ID"],
      groups: "internal-testers"
    )
  end

  lane :deploy_production do
    match(type: "appstore")
    build_app(scheme: "MyApp")
    upload_to_app_store
  end
end

Step 6: Version Management

ApproachHow It Works
ManualDeveloper bumps version in pubspec.yaml / build.gradle / Info.plist
CI-driven build numberVersion name is manual, build number = CI run number
Semantic versioning + changelogUse cider (Flutter), Fastlane increment_build_number, or custom scripts
Git tag-basedTag triggers release, version derived from tag name

Recommended: Manual version name (marketing version) + CI-generated build number (monotonically increasing).

Output Format

## Mobile CI/CD Summary
- **Platform:** [Flutter / Android / iOS]
- **CI Tool:** [GitHub Actions / Bitrise / Codemagic / CircleCI]
- **Distribution:** [Firebase App Distribution / TestFlight / Play Store]

## Pipeline Stages
[Stage diagram or ordered list]

## Code Signing Configuration
[How certificates/keystores are managed]

## Build Variants
[Debug / Staging / Release configuration]

## Caching Strategy
[What is cached, expected time savings]

## Distribution Lanes
[How builds reach testers and production]

## Version Management
[How version name and build number are managed]

Quality Checklist

  • Code signing credentials are in CI secrets, never in the repo
  • Build cache is configured for dependencies and build artifacts
  • Unit and widget tests run on every PR
  • Integration tests run post-merge or nightly
  • Distribution to testers is automated (no manual APK/IPA sharing)
  • Version and build number management is automated
  • Pipeline can build all variants (debug, staging, release)
  • Secrets rotation procedure is documented
  • Build times are monitored and optimized (target: < 15 min for PR builds)

Edge Cases

  • iOS builds require macOS runners — account for cost and availability when choosing CI platform
  • If using Fastlane Match, ensure the certificates repo access is configured in CI
  • For Flutter, flutter build can be slow on first run — pre-warm with cached build directory
  • For monorepos with multiple apps, use path-based triggers to only build affected apps
  • Apple's provisioning profile and certificate management changes frequently — prefer Fastlane Match or Xcode Cloud to reduce manual maintenance
  • For apps distributed outside the stores (enterprise), manage signing certificates carefully as they expire annually
Gespeicherte Skills