DalaDev.Deployer (dala_dev v0.4.0)

Copy Markdown View Source

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

Summary

Functions

Collects BEAM directories from the current build. Public for dry-run.

Counts BEAM files in the given dirs. Public for dry-run.

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

Functions

collect_beam_dirs()

@spec collect_beam_dirs() :: [String.t()]

Collects BEAM directories from the current build. Public for dry-run.

count_beams(beam_dirs)

@spec count_beams([String.t()]) :: non_neg_integer()

Counts BEAM files in the given dirs. Public for dry-run.

deploy_all(opts \\ [])

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

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