Generates the on-device BEAM entry point invoked by Mob's native shell at app launch:
lib/<app>/mob_app.ex— the entry modulesrc/<app>.erl— Erlang bootstrap that calls<App>.MobApp.start/0mix.exspatches:erlc_paths: ["src"]+erlc_options: [:debug_info]so the Erlang bootstrap gets compiled
Two flavours of mob_app.ex:
- LiveView (default) — calls
Application.ensure_all_started(:<app>)which boots the host Phoenix endpoint, runs Ecto migrations, sets up the on-device runtime config.secret_key_baseis read fromconfig/dev.exsif available (so it matches the host dev server) or freshly generated. - Thin client (with
--no-live-view) — usesuse Mob.Appwithnavigation/1+on_start/0callbacks. Does NOT boot Phoenix on-device; the WebView points at a deployed Phoenix server (setconfig :mob, host_url: ...). The device's BEAM is just the native interop layer.
Options
--no-live-view— generate the thin-clientmob_app.exinstead of the LiveView-flavoured one. Pairs with thebridgesub-task being skipped under the same flag.
Other orchestrator flags accepted but inert.
Idempotency
- Files are created with
on_exists: :skip. Re-running won't overwrite — delete first if you want to switch between LV and thin flavours. erlc_paths/erlc_optionsinjection checks string presence inmix.exsbefore patching.
Typically called by mix mob.adopt, not directly.