Configuration
Create an agent-device.json file to set persistent CLI defaults instead of repeating flags on every command.
Config file locations
agent-device checks these sources in priority order:
Project-level values override user-level values. Environment variables override both. CLI flags always win.
Use --config <path> or AGENT_DEVICE_CONFIG to load one specific config file instead of the default locations.
Config format
Config files use JSON objects with camelCase keys matching existing CLI flag names.
Environment variables follow the same fields using AGENT_DEVICE_* uppercase snake case names, for example:
session->AGENT_DEVICE_SESSIONdaemonBaseUrl->AGENT_DEVICE_DAEMON_BASE_URLiosSimulatorDeviceSet->AGENT_DEVICE_IOS_SIMULATOR_DEVICE_SETandroidDeviceAllowlist->AGENT_DEVICE_ANDROID_DEVICE_ALLOWLIST
When a CLI option has multiple flag aliases, config and environment sources use the canonical option value rather than a flag alias. Example:
- config:
"appsFilter": "user-installed" - env:
AGENT_DEVICE_APPS_FILTER=user-installed - not:
--user-installed
Legacy compatibility env vars are still accepted for device scoping:
IOS_SIMULATOR_DEVICE_SETANDROID_DEVICE_ALLOWLIST
Example:
Common keys include:
stateDirdaemonBaseUrldaemonAuthTokendaemonTransportdaemonServerModetenantsessionIsolationrunIdleaseIdsessionLocksessionLockedsessionLockConflictsplatformtargetdeviceudidserialiosSimulatorDeviceSetandroidDeviceAllowlistsessionverbosejson
Command-specific defaults are supported too, for example snapshotDepth, snapshotScope, activity, relaunch, shutdown, fps, stepsFile, or saveScript.
Bound-session defaults use the same config and env mapping too:
sessionLock->AGENT_DEVICE_SESSION_LOCKsessionLocked->AGENT_DEVICE_SESSION_LOCKEDsessionLockConflicts->AGENT_DEVICE_SESSION_LOCK_CONFLICTS
Command-specific defaults
Command-specific keys are applied only when the current command supports them.
Examples:
- A default
snapshotDepthapplies tosnapshot,diff snapshot,click,fill,get,wait,find, andis. - The same
snapshotDepthvalue is ignored for commands likeopen,close, ordevices.
This keeps one shared config file usable across different command families.
Failure behavior
- If
--configorAGENT_DEVICE_CONFIGpoints to a missing file, agent-device fails during CLI parse before contacting the daemon. - Invalid JSON, unknown keys, or invalid values in config files also fail during CLI parse with
INVALID_ARGS.
