# mob_dev v0.3.28 - Table of Contents

Development tooling for the Mob mobile framework

## Pages

- [mob_dev](readme.md)

- Guides
  - [Publishing to TestFlight (iOS)](publishing_to_testflight.md)

## Modules

- Server
  - [MobDev.Server.DashboardLive](MobDev.Server.DashboardLive.md)
  - [MobDev.Server.DevicePoller](MobDev.Server.DevicePoller.md): Polls adb and simctl every 2 seconds, broadcasting device state changes via PubSub.

  - [MobDev.Server.ElixirLogBuffer](MobDev.Server.ElixirLogBuffer.md): Holds the last N server-side Elixir log lines in memory so the dashboard
can restore them on reconnect. Fed by `MobDev.Server.ElixirLogger`.

  - [MobDev.Server.ElixirLogger](MobDev.Server.ElixirLogger.md): OTP logger handler that captures Elixir `Logger` output and forwards it
to the Mob dev server dashboard.
  - [MobDev.Server.Endpoint](MobDev.Server.Endpoint.md)
  - [MobDev.Server.Layouts](MobDev.Server.Layouts.md)
  - [MobDev.Server.LogBuffer](MobDev.Server.LogBuffer.md): Holds the last N log lines in memory so the LiveView can restore them on
reconnect without losing context from before a crash or page refresh.

  - [MobDev.Server.LogFilter](MobDev.Server.LogFilter.md): Pure filter functions for the log stream. Extracted here so they can be
unit-tested without mounting a LiveView.

  - [MobDev.Server.LogStreamer](MobDev.Server.LogStreamer.md): Streams logcat from connected Android devices and iOS simulator console,
broadcasting parsed lines via PubSub.
  - [MobDev.Server.LogStreamerSupervisor](MobDev.Server.LogStreamerSupervisor.md): Isolated supervisor for LogStreamer.
  - [MobDev.Server.Router](MobDev.Server.Router.md)
  - [MobDev.Server.WatchWorker](MobDev.Server.WatchWorker.md): GenServer that runs the mob.watch loop inside the mob.server process.

- Internals
  - [MobDev.Bench.DeviceObserver](MobDev.Bench.DeviceObserver.md): Subscribes to `Mob.Device` events on the running app over Erlang
distribution and tracks ground-truth screen/app state for the bench.
  - [MobDev.Bench.Logger](MobDev.Bench.Logger.md): Append-only CSV log of bench probe snapshots.
  - [MobDev.Bench.Preflight](MobDev.Bench.Preflight.md): Pre-run checklist for the iOS battery bench.
  - [MobDev.Bench.Probe](MobDev.Bench.Probe.md): Multi-source state probe for the battery bench.
  - [MobDev.Bench.Reconnector](MobDev.Bench.Reconnector.md): Auto-reconnect logic for the bench's BEAM dist connection.
  - [MobDev.Bench.Summary](MobDev.Bench.Summary.md): Post-run analysis of a bench CSV log.
  - [MobDev.Connector](MobDev.Connector.md): Orchestrates device discovery, tunnel setup, app restart, and node connection.

  - [MobDev.Deployer](MobDev.Deployer.md): Pushes compiled BEAM files from `_build/dev/lib/*/ebin/` to connected devices.
  - [MobDev.Device](MobDev.Device.md): Represents a connected or available device (physical or emulator/simulator).

  - [MobDev.Discovery.Android](MobDev.Discovery.Android.md): Discovers Android devices and emulators via adb.
  - [MobDev.Discovery.IOS](MobDev.Discovery.IOS.md): Discovers iOS simulators via xcrun simctl.
  - [MobDev.Emulators](MobDev.Emulators.md): List, start, and stop Android emulators (AVDs) and iOS simulators.
  - [MobDev.Enable](MobDev.Enable.md): Pure helpers for `mix mob.enable` — extracted for testability.
  - [MobDev.ErrorView](MobDev.ErrorView.md)
  - [MobDev.HotPush](MobDev.HotPush.md): Connects to already-running device nodes and hot-pushes BEAM modules via RPC.
  - [MobDev.IconGenerator](MobDev.IconGenerator.md): Generates app icons for Android and iOS from either a random robot avatar
(using Avatarz) or a provided source image (using Image).
  - [MobDev.NativeBuild](MobDev.NativeBuild.md): Builds native binaries (APK for Android, .app bundle for iOS simulator)
for the current Mob project.
  - [MobDev.Network](MobDev.Network.md): Network utilities for mob_dev.
  - [MobDev.OtpDownloader](MobDev.OtpDownloader.md): Downloads and caches pre-built OTP releases from GitHub for Android and iOS simulator.
  - [MobDev.Paths](MobDev.Paths.md): Resolution helpers for paths Mob writes to outside the project tree.
  - [MobDev.QR](MobDev.QR.md): Renders QR codes in the terminal using Unicode half-block characters.
Uses eqrcode for matrix generation.

  - [MobDev.Release](MobDev.Release.md): Build a signed, App-Store-ready iOS `.ipa` for the current Mob project.
  - [MobDev.Tunnel](MobDev.Tunnel.md): Manages port tunnels for Android and physical iOS devices.

## Mix Tasks

- Mix Tasks
  - [mix mob.battery_bench_android](Mix.Tasks.Mob.BatteryBenchAndroid.md): Builds a benchmark APK, deploys it, and measures battery drain over time.
  - [mix mob.battery_bench_ios](Mix.Tasks.Mob.BatteryBenchIos.md): Builds a benchmark app, deploys it to a physical iPhone/iPad, and measures
battery drain over time.
  - [mix mob.cache](Mix.Tasks.Mob.Cache.md): Inspects every cache `mix mob.*` writes to outside the project tree, and
(with `--clear`) deletes them. Distinct from `mix clean` (build artifacts
in `_build/`) and `mix deps.clean` (deps in `deps/`) — this targets caches
in your home directory that survive across projects.
  - [mix mob.connect](Mix.Tasks.Mob.Connect.md): Discovers connected Android and iOS devices, sets up USB tunnels,
restarts the app on each device, waits for Erlang nodes to come online,
then drops into an IEx session connected to all of them.
  - [mix mob.deploy](Mix.Tasks.Mob.Deploy.md): Compiles the project then pushes BEAM files to all connected
Android devices and iOS simulators.
  - [mix mob.devices](Mix.Tasks.Mob.Devices.md): Scans for connected Android devices (via adb) and iOS simulators/physical
devices (via xcrun simctl / ideviceinfo) and prints their status.
  - [mix mob.doctor](Mix.Tasks.Mob.Doctor.md): Checks your environment, project configuration, OTP caches, and connected
devices, reporting any issues with specific fix instructions.
  - [mix mob.emulators](Mix.Tasks.Mob.Emulators.md): Manage virtual devices: Android emulators (AVDs) and iOS simulators.
  - [mix mob.enable](Mix.Tasks.Mob.Enable.md): Enables one or more optional Mob features by patching `mix.exs`, manifest
files, and generating any required source files.
  - [mix mob.gen.live_screen](Mix.Tasks.Mob.Gen.LiveScreen.md): Generates a paired `Mob.Screen` and Phoenix `LiveView` for LiveView mode apps.
  - [mix mob.icon](Mix.Tasks.Mob.Icon.md): Generates platform icons for the current Mob project.
  - [mix mob.install](Mix.Tasks.Mob.Install.md): Runs first-time setup for a Mob project generated by `mix mob.new`.
  - [mix mob.provision](Mix.Tasks.Mob.Provision.md): Registers your app's bundle ID with Apple and downloads an iOS
provisioning profile.
  - [mix mob.publish](Mix.Tasks.Mob.Publish.md): Uploads a release-signed `.ipa` to App Store Connect using `xcrun altool`
with App Store Connect API key authentication. The build then appears in
TestFlight after Apple finishes processing (typically 5-15 minutes).
  - [mix mob.push](Mix.Tasks.Mob.Push.md): Compiles the project and hot-pushes updated BEAM modules to all running
Android and iOS devices — no app restart.
  - [mix mob.release](Mix.Tasks.Mob.Release.md): Builds a release-signed iOS `.ipa` ready to upload to App Store Connect.
  - [mix mob.routes](Mix.Tasks.Mob.Routes.md): Walks all `lib/**/*.ex` files and checks that every module passed to
`push_screen/2`, `reset_to/2`, or `pop_to/2` resolves to a loadable module.
  - [mix mob.server](Mix.Tasks.Mob.Server.md): Starts the Mob dev server and opens it in the browser.
  - [mix mob.watch](Mix.Tasks.Mob.Watch.md): Watches `lib/` for source changes and automatically compiles + hot-pushes
updated modules to all running Android and iOS devices.
  - [mix mob.watch_stop](Mix.Tasks.Mob.WatchStop.md): Stops a running `mix mob.watch` process.

