Launchbay

Builds

What a build job does, from copying the checkout to the signed artifact.

launchbay build --platform all --profile production   # one job per platform, on its own lane
launchbay build --platform ios --simulator             # simulator .app, no signing
launchbay build --platform android --apk --at 02:00

Each build job:

  1. Copies the git checkout (tracked and untracked-but-not-ignored files, like EAS) into ~/.launchbay/work/<app>-<hash>-<platform>-<n>, so iOS and Android builds of one app run side by side. The path is the same for every build of that app and platform (a second slot when two overlap), which keeps native compiles cacheable. Ignored files such as .env.local are not copied; put build env in the eas.json profile.
  2. Installs dependencies from the lockfile (bun, pnpm, yarn or npm, frozen).
  3. Runs expo prebuild unless the native folder is committed (a bare project), same rule as EAS.
  4. iOS: xcodebuild archive + -exportArchive, or a simulator build. Every app and extension target gets an installed profile for its bundle id and that profile's certificate from the login keychain, the same material appsign install puts on the Mac. The profile kind follows the eas.json profile: App Store by default, ad hoc for distribution: internal, development for distribution: internal with developmentClient: true (EAS uses ad hoc there; Xcode's development profiles, wildcard ones included, are what most Macs have), and enterprise for ios.enterpriseProvisioning: "universal". Xcode-managed profiles (Xcode's team profiles) are used with automatic signing, others with manual signing. Launchbay never lets Xcode create certificates or profiles (no -allowProvisioningUpdates): Apple caps Distribution certificates per account. The team is LAUNCHBAY_APPLE_TEAM_ID, else appleTeamId from eas.json's submit profiles, else the team on the keychain's distribution certificate. Android: gradlew :app:bundleRelease (or assembleRelease for --apk), signed with the upload key from the project's credentials.json (the layout eas-cli credentials and appsign install write: android.keystore.keystorePath, keystorePassword, keyAlias, keyPassword), so each app gets its own key. Without one, LAUNCHBAY_ANDROID_KEYSTORE, _KEYSTORE_PASSWORD, _KEY_ALIAS (and optionally _KEY_PASSWORD) on the daemon are used; without those, the project's own release config, which for the Expo template is the debug key.
  5. Copies the artifact to ~/.launchbay/artifacts/<job>/; the workdir is deleted when the build ends.

Like EAS, a build runs the app's package.json lifecycle scripts if it has them: eas-build-pre-install before step 2, eas-build-post-install after steps 2 and 3, then eas-build-on-success or eas-build-on-error after step 4, and eas-build-on-complete last, with EAS_BUILD_STATUS set to finished or errored. Each gets EAS_BUILD_PLATFORM and EAS_BUILD_PROFILE, and runs through the app's package manager (bun run, npm run, ...). A failing hook fails the build, except one that runs after the build already failed: its error is logged and the build's own error stands.

Since every job starts from a fresh copy, Android builds use Gradle's local build cache (--build-cache) and, when ccache is on the daemon's PATH, ccache for the native CMake builds (brew install ccache). For Helm, that took a warm Android build from 184s to 74s, with every native compile a ccache hit. Each build counts its own hits and misses (through CCACHE_STATSLOG, so overlapping builds don't mix), prints them at the end of the log, and the History tab shows the latest hit rate per kind. Dependencies come from the package manager's own global cache.

A build fails at once if the volume holding ~/.launchbay has less than 10 GB free, instead of running out partway through Xcode or Gradle; launchbay prune frees old artifacts and logs.

From an eas.json profile it reads extends, env, distribution, developmentClient and ios.enterpriseProvisioning (which pick the export method, above), autoIncrement, channel (the EAS Update channel, set as expo-updates' expo-channel-name header, as EAS does), ios.simulator, ios.buildConfiguration, ios.scheme, android.buildType and android.gradleCommand. As on EAS, a developmentClient profile builds Debug (ios.buildConfiguration Debug, gradleCommand :app:assembleDebug) unless it sets those itself, which is what turns its dev launcher on. Everything else is ignored for now. Builds run with EXPO_RELEASE=1, so an app config can leave dev-only plugins out.

With autoIncrement, the build number is one past the highest the store already has, read with the submit profile's credentials (below) before the build starts. A store hiccup (a 5xx, a 429, no answer) is retried after 5, 15 and 45 seconds; anything else, or a hiccup that outlasts that, fails the build with the store's error rather than building with a number the store would reject. Turn autoIncrement off to build with the project's own number.

Apps without Expo can keep the same settings in launchbay.toml; see Settings.

Native Android apps

An app with no package.json and gradlew at its root is built as a native Android app: no JS install, prebuild or hooks, just Gradle (:app:bundleRelease, or :app:assembleRelease with --apk, or the profile's android.gradleCommand for another module). Keep its settings in launchbay.toml. Signing, ccache, autoIncrement (Groovy versionCode 1 or Kotlin versionCode = 1 in app/build.gradle(.kts)) and uploads work as for Expo apps; the Play package name comes from the submit profile's applicationId, else app.json, else applicationId in app/build.gradle(.kts).

Native iOS apps

An app with no package.json and its .xcodeproj at the root is built as a native iOS app: no JS install, prebuild or hooks. Its own Podfile, if any, is installed; a project without one (Swift packages only) builds with -project instead of -workspace, and Xcode resolves its packages. The scheme is the profile's ios.scheme, else the one named after the project. Signing, export methods, autoIncrement (agvtool, so the project needs VERSIONING_SYSTEM = apple-generic) and uploads work as for Expo apps. Keep its settings in launchbay.toml.

Flutter apps

An app with a pubspec.yaml on the Flutter SDK is built with flutter (which must be on the daemon's PATH: rerun launchbay service install after installing it). Every build runs flutter pub get. Android is flutter build appbundle (or apk with --apk), signed with the same upload key as other Android builds; Flutter's own bundle step needs the Android SDK's command-line tools. iOS runs flutter build ios --config-only, then the usual archive, signing and export of ios/Runner; --simulator is flutter build ios --simulator, a debug build, the only kind Flutter makes for the simulator. With autoIncrement the store's next number goes in as --build-number. Settings live in launchbay.toml; uploads and promotes work as for any app (set ascAppId for iOS, since there's no app.json; Android's package comes from app/build.gradle(.kts)).

Release tags

launchbay build --platform all --ref v1.2.0          # build a tag, branch or commit, not the working tree
launchbay tags watch --pattern 'v*' --submit         # build (and upload) every new matching tag
launchbay tags ls
launchbay tags unwatch --pattern 'v*'

--ref builds the commit's files as git archive has them, so uncommitted edits and untracked files stay out, and its settings come from that commit's own eas.json or launchbay.toml. A watch remembers the tags that match when it's made as already built; the daemon then runs git fetch --tags for each watched app at start and every 5 minutes, and queues a --ref build of each new match (with --platform, --profile and --submit from the watch), once. Watches are in ~/.launchbay/tag-watches.json, handled tags in tag-seen.json.

On this page