# `MobDev.ReleaseAndroid`
[🔗](https://github.com/genericjam/mob_dev/blob/main/lib/mob_dev/release_android.ex#L1)

Builds the signed release AAB for a Mob Android app.

Called by `mix mob.release --android`. The pipeline:

  1. Download the Android OTP runtime (arm64) if not already cached.
  2. Copy the OTP tree to a temp staging dir and add:
     - App + dep BEAMs (flattened into `{app_name}/`)
     - App `priv/` → `{app_name}/priv/`
     - exqlite BEAMs → `lib/exqlite-{vsn}/ebin/` (OTP lib structure needed
       for `:code.lib_dir(:exqlite)` to resolve correctly at runtime)
  3. Run `MobDev.OtpAssetBundle.build/2` — strips unused OTP libs and
     optional BEAM chunks, then zips the tree to `assets/otp.zip`.
  4. Run `./gradlew bundleRelease` — signs the AAB using the keystore
     configured in `android/keystore.properties`.

`MobBridge.extractOtpIfNeeded()` (Kotlin) extracts `otp.zip` into
`<filesDir>/otp/` on first launch. Without this zip the app crashes
immediately — the BEAM has no runtime or application BEAMs to load.

# `build_aab`

```elixir
@spec build_aab(keyword()) :: {:ok, Path.t()} | {:error, String.t()}
```

Runs the full Android release pipeline and returns `{:ok, aab_path}` or
`{:error, reason}`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
