# `DalaDev.OtpDownloader`
[🔗](https://github.com/manhvu/dala_dev/blob/main/lib/mob_dev/otp_downloader.ex#L1)

Downloads and caches pre-built OTP releases from GitHub for Android and iOS simulator.

Artifacts are cached at `~/.dala/cache/` and reused across projects.

## Cache Validation

A valid OTP directory must contain at least one `erts-*` subdirectory.
iOS device tarballs have additional requirements (see `ios_device_extras_present?/1`).

# `android_otp_dir`

```elixir
@spec android_otp_dir(String.t()) :: String.t()
```

Returns the cached Android OTP directory path (may not exist yet).

# `ensure_android`

```elixir
@spec ensure_android(String.t()) :: {:ok, String.t()} | {:error, term()}
```

Ensures the Android OTP release is cached.

Returns `{:ok, path}` on success, `{:error, reason}` on failure.

## Parameters

- `abi`: Android ABI (default: "arm64-v8a"). Use "armeabi-v7a" for 32-bit ARM.

# `ensure_ios_device`

```elixir
@spec ensure_ios_device() :: {:ok, String.t()} | {:error, term()}
```

Ensures the iOS device OTP release is cached.

Returns `{:ok, path}` on success, `{:error, reason}` on failure.

# `ensure_ios_sim`

```elixir
@spec ensure_ios_sim() :: {:ok, String.t()} | {:error, term()}
```

Ensures the iOS simulator OTP release is cached.

Returns `{:ok, path}` on success, `{:error, reason}` on failure.

# `ios_device_otp_dir`

```elixir
@spec ios_device_otp_dir() :: String.t()
```

Returns the cached iOS device OTP directory path (may not exist yet).

# `ios_sim_otp_dir`

```elixir
@spec ios_sim_otp_dir() :: String.t()
```

Returns the cached iOS simulator OTP directory path (may not exist yet).

---

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