mix mob.adopt.screen (mob_dev v0.6.14)

Copy Markdown View Source

Generates lib/<app>/mob_screen.ex — the Mob.Screen that opens the WebView pointed at the host Phoenix endpoint.

The generated module reads the URL from application config:

config :mob, host_url: "https://your-app.example.com/"

Default if unset is http://127.0.0.1:4000/, suitable for on-device BEAM hitting a local Phoenix endpoint. The screen module never has the URL hardcoded.

Options

  • --host-url URL — write config :mob, host_url: URL to config/config.exs. Equivalent to editing config by hand after install; provided as a flag so the install pipeline can be fully declarative. No-op when not given.

Other orchestrator flags (--no-ios, --no-android, --local, --python, --no-live-view) are accepted but inert here — declared in the schema only so mix mob.adopt can forward its full argv to this sub-installer without Igniter rejecting unknown options.

Idempotency

  • lib/<app>/mob_screen.ex is created with on_exists: :skip — if it already exists, contents are left alone. To regenerate, delete the file first.
  • --host-url's config write goes through Igniter.Project.Config, which is idempotent: the key is set to the new value, or left as is if the same value is already present.

Typically called by mix mob.adopt, not directly.