Fastlane (Getting started)
March 28, 2021
Fastlane Basics
Fastlane automatisiert Releases fuer Android und iOS. Wichtig: iOS Builds brauchen macOS (Xcode Pflicht). Android laeuft auch unter Linux/Windows.
Installation
code
# macOS/Linux
brew install fastlane
# RubyGems (alle OS)
sudo gem install fastlane
Initialisierung:
code
fastlane init
Empfohlen: Bundler
Gemfile im Projekt:
code
source "https://rubygems.org"
gem "fastlane"
Dann:
code
bundle install
bundle exec fastlane init
Ab dann immer:
code
bundle exec fastlane <lane>
Projektstruktur
Fastlane erstellt:
code
fastlane/
Appfile
Fastfile
Pluginfile
metadata/
Bei React Native initiiere Fastlane getrennt fuer android/ und ios/, falls du Plattform-spezifische Lanes willst.
Versionsnummern (Android)
In android/app/build.gradle:
versionCode(int)versionName(string)
Release Notes (Android)
Play Store Notes liegen hier:
code
fastlane/metadata/android/en-GB/changelogs/<VERSION_CODE>.txt
Environment Variablen
Fastlane laedt .env automatisch. Mit --env kannst du eine Datei auswaehlen:
code
fastlane test --env production
Beispiel:
code
lane :test do
puts "TOKEN: #{ENV['SOME_API_TOKEN']}"
end
code
# .env
SOME_API_TOKEN=dev
code
# .env.production
SOME_API_TOKEN=prod