> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xenoci.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Build

> Gradle assembleDebug on a Linux machine; the debug APK comes back

> [!NOTE]
>
> **When to use it.** Your agent changed Kotlin or Gradle files and you want to know they compile, without an Android SDK on your machine

## Run it

```bash theme={"system"}
box build --platform android
```

<video controls muted loop playsInline autoPlay preload="metadata" poster="/media/docs/android-build-poster.webp" src="https://mintcdn.com/xenoci/ZFKGlbE4Q2bw14Om/media/docs/android-build.mp4?fit=max&auto=format&n=ZFKGlbE4Q2bw14Om&q=85&s=9bdac30791fa626f5d8d8d667db9cfc2" width="1280" height="778" />

box build --platform android running Gradle and saving the APK

XenoCI Box uploads the changed files, runs Gradle `assembleDebug` and saves the debug APK. Here on [android/compose-samples JetLagged](https://github.com/android/compose-samples/tree/main/JetLagged) (Apache 2.0)

```text theme={"system"}
$ box build --platform android
box: upload: 74 files checked, 0 new (0 bytes), .gitignore respected, .env never sent (snapshot snap_fi48kxrK-WMRe3F3)
box: queue: job bj__ad3mDX3BXh16XQO (build, android, $0.02/min) submitted
box: status: queued
box: machine: assigned, starting its VM (billed from when the VM is ready)
box: status: running
[box] kind=build platform=android project=jetlagged
…
BUILD SUCCESSFUL in 11s
37 actionable tasks: 37 up-to-date
[box] BOX_BUILD_SECONDS=12 rc=0
box: build: done in 12s
box: status: succeeded
box: results: saved to ./.box/out/bj__ad3mDX3BXh16XQO/ (app-debug.apk, build.log)
box: bj__ad3mDX3BXh16XQO succeeded, 60s billed, $0.02
```

> [!NOTE]
>
> Job `bj__ad3mDX3BXh16XQO` on a production Android machine: 60s billed, \$0.02

![The JetLagged build running on an Android emulator](https://mintcdn.com/xenoci/ZFKGlbE4Q2bw14Om/images/docs-feature-android.png?fit=max\&auto=format\&n=ZFKGlbE4Q2bw14Om\&q=85\&s=8bdaf164eac19c6eaafc4d27cde8449f)

## What you get

* `.box/out/<job>/app-debug.apk`, the debug APK, and `build.log`, the whole Gradle log
* The Gradle cache stays between jobs of the same project, so the next build is incremental (the run above: 37 tasks up to date)
* A failed build exits 1 and prints Gradle’s errors; `box why` reads the log for the cause

`box build --device-build` is iOS only and exits 2 with `--platform android`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.