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

Pushes compiled BEAM files from `_build/dev/lib/*/ebin/` to connected devices.

Does NOT rebuild APKs or recompile native code — that's `deploy.sh` (first-time setup).
Use this for day-to-day code iteration: edit Elixir → `mix dala.deploy` → code running.

## Transport selection

**Erlang dist (preferred)**: when a device node is already reachable via Erlang
distribution, BEAMs are hot-loaded via RPC. No restart needed — modules are
loaded in place exactly like `nl/1` in IEx.

**adb push / cp (fallback)**: when no dist connection exists (first deploy, app not
running), falls back to the traditional push-then-restart path.

## Platform behaviour

**Android**: pushes via `adb push` (requires `adb root`, i.e. emulator or debug build),
or falls back to `adb push` → `/data/local/tmp/` → `run-as tar xf` for real devices.

**iOS simulator**: copies files locally into `/tmp/otp-ios-sim/beamhello/` (no network
hop — the simulator shares the Mac filesystem).

# `deploy_all`

```elixir
@spec deploy_all(keyword()) :: {[DalaDev.Device.t()], [DalaDev.Device.t()]}
```

Discovers devices, pushes BEAMs, and optionally restarts apps.
Returns `{deployed, failed}` lists of `%Device{}`.

---

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