# Build, signing and distribution

> The end of the pipeline per target — build.gradle, signing and publishing on each platform.

Source: https://crossfly.dev/docs/platforms/building-and-releasing — CrossFly documentation. Full docs as one file: https://crossfly.dev/llms-full.txt

# Build, signing and distribution 🖥️🤖🍎🌐

The end of the pipeline, per target. Each launcher has its own `build.gradle`; the toolchain is **Java 17**.

## Tasks and artifacts per target
| Target | Build | `mainClassName` | Artifact |
|---|---|---|---|
| 🖥️ Desktop | `gradlew :lwjgl3:run` (dev) / jar / installer | `dev.crossfly.lwjgl3.Lwjgl3Launcher` | jar / native installer |
| 🤖 Android | `gradlew :android:installDebug` / `assembleRelease` | `AndroidLauncher` | APK / **AAB** |
| 🍎 iOS | `gradlew :ios:launchIPhoneSimulator` / generate `.ipa` | `dev.crossfly.IOSLauncher` | **`.ipa`** |
| 🌐 Web | `gradlew :web:webBundle` (alias `dist`) | `dev.crossfly.web.WebLauncher` | static bundle |

## Signing
| Target | Signing |
|---|---|
| 🤖 Android | **keystore** → signs the release `.aab`/APK |
| 🍎 iOS | **certificate + provisioning profile** → signs the `.ipa` |
| 🖥️ Desktop | installer signing per the OS (optional) |
| 🌐 Web | no signing — it is static content |

## Distribution
- **🤖 Android** → Google Play (AAB) or direct APK.
- **🍎 iOS** → App Store / **TestFlight** (via Xcode/Transporter).
- **🖥️ Desktop** → native installers (jpackage/jlink) or executable jar.
- **🌐 Web** → host the contents of `web/build/webapp/` on **any static server**.

## Release checklist
- [ ] Tested on desktop and the real target (see [Testing](/docs/best-practices/testes)).
- [ ] Responsiveness validated on screens/densities (see [Responsiveness](/docs/best-practices/responsividade)).
- [ ] Permissions declared (Android `Manifest` / iOS `Info.plist`).
- [ ] Platform-unavailable features handled (see [Matrix](/docs/platforms/overview)).
- [ ] Signing configured (keystore / provisioning).
- [ ] Icons, *launch screen*, version/build number.
- [ ] Store screenshots generated (`Main.getScreenShot(true).toPng(...)`).

## Prerequisites per target
- **🖥️ Desktop:** JDK 17; on macOS, `-XstartOnFirstThread`.
- **🤖 Android:** Android SDK + build tools.
- **🍎 iOS:** **macOS + Xcode** + Apple developer account.
- **🌐 Web:** static file server.

## Common mistakes
- Submitting iOS without usage keys in the `Info.plist` (rejection).
- Publishing an APK when the Play Store requires an **AAB**.
- Hosting the web bundle without serving the `assets/`/`assets.txt` alongside it.

## See also
- [Desktop](/docs/platforms/desktop-lwjgl3) · [Android](/docs/platforms/android) · [iOS](/docs/platforms/ios) · [Web](/docs/platforms/web-teavm)
