> ## 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.

# Android emulator quickstart

> The same commands as iOS, with --platform android

> [!NOTE]
>
> XenoCI Box builds, tests and screenshots Android apps on a Linux Android emulator with the same commands as iOS. Add `--platform android`, or let box find `settings.gradle` or `gradlew` in your project

**1. Install and sign in**

The same CLI and the same account as iOS. If box is already set up, skip to the next step

```bash theme={"system"}
curl -fsSL https://xenoci.com/install.sh | sh
box login
```

Every way to install and sign in is on [Install and sign in](https://docs.xenoci.com/ios/install.md)

**2. Build**

From the folder with `settings.gradle` or `gradlew`. Here it is the public sample [android/compose-samples JetLagged](https://github.com/android/compose-samples/tree/main/JetLagged) (Apache 2.0)

```bash theme={"system"}
git clone https://github.com/android/compose-samples
cd compose-samples/JetLagged
```

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

Android: box build, box test and box screenshot, ending on the screen the job saved

```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
```

**3. See the app**

```text theme={"system"}
$ box screenshot --platform android
box: queue: job bj_62GxzEFVpVFdUKgf (screenshot, android, $0.02/min) submitted
…
box: build: done in 11s
[box] emulator ready (4.5s)
Performing Streamed Install
Success
Starting: Intent { cmp=com.example.jetlagged/.MainActivity }
…
[box] screenshot box-out/screen.png
box: status: succeeded
box: results: saved to ./.box/out/bj_62GxzEFVpVFdUKgf/ (app-debug.apk, build.log, emulator.log, screen.png)
box: bj_62GxzEFVpVFdUKgf succeeded, 60s billed, $0.02
```

![The JetLagged sample on an Android emulator: the Sleep chart for the week, as box saved it](https://mintcdn.com/xenoci/ZFKGlbE4Q2bw14Om/images/docs-feature-android.png?fit=max\&auto=format\&n=ZFKGlbE4Q2bw14Om\&q=85\&s=8bdaf164eac19c6eaafc4d27cde8449f)

The picture box saved, made smaller for this page

## What to look at next

> [card] [Test](https://docs.xenoci.com/android/test.md)
>
> Run your JVM unit tests and read what failed

> [card] [Run and tap](https://docs.xenoci.com/android/run.md)
>
> Keep the app open and drive it with box ui

> [card] [Exec](https://docs.xenoci.com/android/exec.md)
>
> Any Gradle task or shell command on the machine

> [card] [Pricing](https://docs.xenoci.com/reference/pricing.md)
>
> What an Android minute costs

## How it differs from iOS

* Every job command takes `--platform ios` or `--platform android`, and so does every MCP job tool (`platform`)
* Without it, box looks at the project folder: an Xcode project, `project.yml`, `Package.swift` or an `ios/` folder means iOS; `settings.gradle`, `gradlew` or an `android/` folder means Android
* When both are there (Flutter, React Native, Expo), box picks neither and exits 2 asking for `--platform`, so no job runs on the platform you did not mean
* To fix the choice for a project, put `platform = "android"` (or `"ios"`) in `.box.toml`. `--platform` still wins
* Android has one size: 4 vCPU / 16 GB. It runs on a Linux Android emulator, and the emulator boot time is not billed
* `--xcode` is for iOS only; with `--platform android` it exits 2
* `box debug` and `box build --device-build` are iOS only and exit 2 on Android. `box test` runs every unit test (Gradle `testDebugUnitTest`), so `--only-testing` is not used
* The debug APK is saved as `.box/out/<job>/app-debug.apk`. The Gradle cache stays between jobs of the same project, so the next build is incremental

Android costs \$0.02 per minute on the one Android size (4 vCPU / 16 GB), from the same US dollar balance as the Mac. The emulator boot time is not billed. The current rate is at [xenoci.com/api/v1/pricing](https://xenoci.com/api/v1/pricing), and every job prints its rate when it is submitted


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