API Reference mob_dev v#0.3.28

Copy Markdown View Source

Modules

Subscribes to Mob.Device events on the running app over Erlang distribution and tracks ground-truth screen/app state for the bench.

Append-only CSV log of bench probe snapshots.

Pre-run checklist for the iOS battery bench.

Multi-source state probe for the battery bench.

Auto-reconnect logic for the bench's BEAM dist connection.

Post-run analysis of a bench CSV log.

Orchestrates device discovery, tunnel setup, app restart, and node connection.

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

Represents a connected or available device (physical or emulator/simulator).

Discovers Android devices and emulators via adb.

Discovers iOS simulators via xcrun simctl.

List, start, and stop Android emulators (AVDs) and iOS simulators.

Pure helpers for mix mob.enable — extracted for testability.

Connects to already-running device nodes and hot-pushes BEAM modules via RPC.

Generates app icons for Android and iOS from either a random robot avatar (using Avatarz) or a provided source image (using Image).

Builds native binaries (APK for Android, .app bundle for iOS simulator) for the current Mob project.

Network utilities for mob_dev.

Downloads and caches pre-built OTP releases from GitHub for Android and iOS simulator.

Resolution helpers for paths Mob writes to outside the project tree.

Renders QR codes in the terminal using Unicode half-block characters. Uses eqrcode for matrix generation.

Build a signed, App-Store-ready iOS .ipa for the current Mob project.

Polls adb and simctl every 2 seconds, broadcasting device state changes via PubSub.

Holds the last N server-side Elixir log lines in memory so the dashboard can restore them on reconnect. Fed by MobDev.Server.ElixirLogger.

OTP logger handler that captures Elixir Logger output and forwards it to the Mob dev server dashboard.

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.

Pure filter functions for the log stream. Extracted here so they can be unit-tested without mounting a LiveView.

Streams logcat from connected Android devices and iOS simulator console, broadcasting parsed lines via PubSub.

Isolated supervisor for LogStreamer.

GenServer that runs the mob.watch loop inside the mob.server process.

Manages port tunnels for Android and physical iOS devices.

Mix Tasks

Builds a benchmark APK, deploys it, and measures battery drain over time.

Builds a benchmark app, deploys it to a physical iPhone/iPad, and measures battery drain over time.

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.

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.

Compiles the project then pushes BEAM files to all connected Android devices and iOS simulators.

Scans for connected Android devices (via adb) and iOS simulators/physical devices (via xcrun simctl / ideviceinfo) and prints their status.

Checks your environment, project configuration, OTP caches, and connected devices, reporting any issues with specific fix instructions.

Manage virtual devices: Android emulators (AVDs) and iOS simulators.

Enables one or more optional Mob features by patching mix.exs, manifest files, and generating any required source files.

Generates a paired Mob.Screen and Phoenix LiveView for LiveView mode apps.

Generates platform icons for the current Mob project.

Runs first-time setup for a Mob project generated by mix mob.new.

Registers your app's bundle ID with Apple and downloads an iOS provisioning profile.

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

Compiles the project and hot-pushes updated BEAM modules to all running Android and iOS devices — no app restart.

Builds a release-signed iOS .ipa ready to upload to App Store Connect.

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.

Starts the Mob dev server and opens it in the browser.

Watches lib/ for source changes and automatically compiles + hot-pushes updated modules to all running Android and iOS devices.

Stops a running mix mob.watch process.