Irbisa · Cheatsheet
CI/CD & DevOps
GitHub Actions, Fastlane, Firebase Distribution, flavors
What is the difference between an APK and an AAB, and what does a signed release build for Google Play and the App Store involve?
// android/app/build.gradle.ktsimport java.util.Properties val keystoreProperties = Properties().apply { val file = rootProject.file("key.properties") // gitignored, written by CI if (file.exists()) file.inputStream().use { load(it) }…How do you manage app versioning in Flutter: the version name, the build number, and who bumps them?
Trunk-based or GitFlow for a mobile app: how do you ship a hotfix to the store version while
mainalready holds next week's unfinished features?# Store: 1.4.2 (tag v1.4.2). main: 1.5 work, unfinished parts behind flags.# 1) The fix is merged into main through a normal PR first.FIX=$(git log origin/main --format=%H -1 --grep='fix: crash on empty cart') # 2) Branch from what users run, not from main.git switch -c release/1.4 v1.4.2 # or switch to the existing release/1.4…What are flavors in Flutter, and how do you set up dev, staging and production builds?
// android/app/build.gradle.ktsandroid { flavorDimensions += "environment" productFlavors { create("dev") { dimension = "environment"…How does
--dart-define-from-filediffer from--flavor, and how can a production-signed build end up calling the staging API?// flutter build appbundle --flavor prod --dart-define-from-file=config/prod.json// config/prod.json: {"API_URL": "https://api.example.com"}import 'package:flutter/services.dart' show appFlavor; class AppConfig { // const and no defaultValue: a missing define is an empty string, never "dev"…What is fastlane, and what does it give you over a hand-written CI script?
# ios/fastlane/Fastfiledefault_platform(:ios) platform :ios do before_all do setup_ci # temporary keychain; no-op outside CI…How do you choose between GitHub Actions, Codemagic, Bitrise and Xcode Cloud for a Flutter app?
How do you sign Android and iOS builds in CI without leaking the keys?
# .github/workflows/release.yml (Android part)jobs: android: runs-on: ubuntu-latest environment: production # secrets released only after approval steps:…How do you distribute beta builds: Firebase App Distribution, TestFlight or Play testing tracks?
# .github/workflows/beta.ymlname: betaon: push: branches: [main]…How do you automate Play Store and App Store uploads from CI?
# android/fastlane/Fastfiledefault_platform(:android) platform :android do lane :internal do upload_to_play_store(…What are the usual reasons App Review or Google Play rejects a Flutter app's submission, and how do you catch them before you submit?
The app works in debug but crashes or has no network in release. What are the usual causes, and how do you catch them before users do?
#!/usr/bin/env bashset -euo pipefail # 1) Build the binary users will get; `flutter test` never builds it.flutter build apk --release --flavor prod \ --dart-define-from-file=config/prod.json \…The iOS CI job fails with "Generated.xcconfig must exist" although the runner has your Xcode. What is a fresh checkout missing?
#!/usr/bin/env bashset -euo pipefail # Pin the Xcode this project is tested with; images ship several.sudo xcode-select -s "/Applications/Xcode_${XCODE_VERSION}.app"…How would you design a CI/CD pipeline for a Flutter app: what runs on every pull request, what runs on release, and on which runners?
# .github/workflows/ci.ymlname: cion: pull_request: push: tags: ['v*']…What makes a Flutter app ready for its first production release, beyond passing tests?
Every pull request waits 40 minutes on CI. Where does the time go in a Flutter pipeline, and what do you cut first?
name: cion: [pull_request] concurrency: # a new push cancels the old run group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true…How do you roll out a release in stages, and what do you do when the new version turns out to be broken?
What is code push with Shorebird, what can a patch change, and how do you force users onto a new version when a patch cannot help?
# The store build must come from Shorebird, not from plain `flutter build`.# Arguments after `--` are passed through to flutter build.shorebird release android --flavor prod -- --dart-define-from-file=config/prod.jsonshorebird release ios --flavor prod -- --dart-define-from-file=config/prod.json # Later: a Dart-only fix for users on 1.4.2+87, built with the same defines.…A monorepo with an app and fifteen packages runs every test for a one-line change in one of them. How do you make CI test only what that change can break?
# pubspec.yaml at the repo root (pub workspace + Melos 7)name: acme_workspaceenvironment: sdk: ^3.9.0workspace: - apps/shop…