Environment Variables¶
Most users can use the defaults. Set these variables when you need a different state directory, logs, tool set, or device behavior.
State and logs¶
| Variable | Use | Default |
|---|---|---|
AUTOMOBILE_DATA_DIR |
Base directory for observe, accessibility, navigation, CtrlProxy-build, screen-streaming, WebRTC, tool-output, and daemon-failure artifacts | ~/.auto-mobile |
AUTOMOBILE_LOG_DIR |
Directory for daemon and client logs | ~/.auto-mobile/logs |
AUTOMOBILE_LOG_FORMAT |
text or newline-delimited json |
text |
AUTOMOBILE_LOG_SINK |
file, stderr, or both |
file |
AUTOMOBILE_COORDINATION_DIR |
Absolute, shared directory for cross-process CtrlProxy forwarding leases | OS account home .auto-mobile |
For container log collection:
export AUTOMOBILE_DATA_DIR=/var/lib/automobile
export AUTOMOBILE_LOG_FORMAT=json
export AUTOMOBILE_LOG_SINK=stderr
Some persistent stores still use fixed paths under ~/.auto-mobile, including
device snapshots, video archives, and downloaded libwebp tools. Set their
feature-specific options where available; AUTOMOBILE_DATA_DIR does not
currently relocate them.
Set AUTOMOBILE_COORDINATION_DIR when the OS account home is read-only or when
AutoMobile agents that share an ADB server need an explicit shared lease root.
All cooperating agents must use the same absolute path. The legacy
AUTO_MOBILE_COORDINATION_DIR alias is accepted when the preferred name is
unset.
Database¶
| Variable | Use | Default |
|---|---|---|
AUTOMOBILE_DB_PATH |
Exact SQLite database path | ~/.auto-mobile/auto-mobile.db |
AUTOMOBILE_DB_DIR |
Directory containing auto-mobile.db |
unset |
AUTOMOBILE_DB_PATH takes precedence over AUTOMOBILE_DB_DIR. Relative paths
are resolved from the daemon’s launch directory. Use a path unique to each
concurrent instance:
export AUTOMOBILE_DB_PATH="$PWD/.auto-mobile/auto-mobile.db"
Do not use AUTOMOBILE_DB_PATH=:memory: in production. It is allowed only
for tests that also set AUTOMOBILE_ALLOW_IN_MEMORY_DB=1.
Tool defaults¶
export AUTOMOBILE_ENABLED_TOOLS=clipboard,sqlQuery
export AUTOMOBILE_DISABLED_TOOLS=observe
Tool names are exact and case-sensitive. Unknown names and same-layer
enable/disable conflicts fail startup. Repeatable --enable-tool and
--disable-tool flags override these environment values; persisted
setToolEnabled choices override startup defaults.
CLI session lifetime¶
Each --cli invocation is its own process, so it cannot send the periodic
heartbeat a long-running MCP connection does. A session acquired or used by
--cli is therefore held on a wall-clock idle timeout instead of the 10 s
heartbeat contract, refreshed by every --cli call that touches it:
export AUTOMOBILE_CLI_SESSION_IDLE_TIMEOUT_MS=600000
The default is 10 minutes, and the ceiling is 1 hour. The value is read from the
--cli process, not the daemon’s, and travels with the invocation, so changing
it takes effect on the very next call — no daemon restart. Sessions owned by a
long-lived MCP client (stdio or HTTP) are unaffected and keep the heartbeat
contract; if such a client takes over a session a --cli call had held, that
session goes back to the heartbeat contract and stops occupying its device for
the idle window once the client disconnects.
Automatic observation screenshots¶
Explicit observe calls retain their existing screenshot behavior. Automatic
observations taken after an action or while resolving observe.waitFor skip
screenshots by default. Opt in to one screenshot from the final result by
setting either skip flag to false (or 0):
export AUTOMOBILE_ACTION_OBSERVATION_SKIP_SCREENSHOT=false
export AUTOMOBILE_OBSERVE_WAIT_FOR_SKIP_SCREENSHOT=false
observe.waitFor suppresses screenshots for all intermediate polls; enabling
its flag captures only once, after the condition resolves or times out.
Device behavior¶
AutoMobile does not create an emulator or simulator by default. The legacy compatibility path can opt in:
export AUTOMOBILE_ALLOW_DEVICE_CREATE=1
auto-mobile --cli startDevice --platform ios --create-if-missing
An explicit --create-if-missing false disables creation even when the
environment variable is set. Created devices can be removed with
xcrun simctl delete <udid> or avdmanager delete avd -n <name>.
Session continuity is enabled by default for a session-bound Android emulator or iOS simulator that AutoMobile owns. If its runtime connection disappears, AutoMobile retains the session for that virtual device’s stable identity. Android may restart the same AVD; iOS recovery is passive and waits for the same simulator UDID to become booted again. To disable that continuity explicitly:
export AUTOMOBILE_DEVICE_RECOVERY_ON_LOSS=0
export AUTOMOBILE_DEVICE_RECOVERY_MAX_ATTEMPTS=2
Setting AUTOMOBILE_DEVICE_RECOVERY_ON_LOSS=1 also enables the broader recovery
policy for eligible idle or unbound AutoMobile-owned Android AVDs. Physical
devices and externally started Android emulators are not restarted. iOS
simulators are never actively restarted by session continuity.
Shared ADB server¶
By default AutoMobile leaves the local ADB server running. Set
AUTOMOBILE_MANAGED_ADB_SERVER=1 only when this process owns the server; a
clean shutdown then stops it after active device sessions are released.
The preferred AUTOMOBILE_* spelling is documented here. Older
AUTO_MOBILE_* aliases are accepted for the state, log, database, recovery,
and ADB settings when the preferred name is unset.