The Appium Config File
Instead of passing arguments on the command line to Appium, you may add them to a special config file. Appium will read values from this config file when it runs. (Please note that CLI arguments have precedence over configuration files; if a value is set in a config file and via CLI argument, the CLI argument is preferred.)
Supported Config File Formats¶
You can store your config data in the following kinds of files:
- CJS (the same as above; the extension is for common JS)
Note: Configuration files in ESM format are not currently supported.
Supported Config File Locations¶
Configuration files can be named anything, but the following filenames will be automatically discovered and loaded by Appium:
.appiumrc(which is considered to be JSON)
Further, if your project uses Node.js, you can use store the configuration inside an
property in your
package.json and it will be automatically discovered.
Config File Search¶
Appium will search up the directory tree from the current working directory for one of these files. If it reaches the current user's home directory or filesystem root, it will stop looking.
To specify a custom location for your config file, use
appium --config-file /path/to/config/file.
Configuration File Format¶
First, you might want to look at some examples:
A description of the format is available, as well:
To describe in words, the config file will have a root
server property, and all arguments are
child properties. For certain properties which must be supplied on the command-line as
comma-delimited lists, JSON strings, and/or external filepaths, these instead will be of their
"native" type. For example,
--use-plugins <value> needs
<value> to be comma-delimited string
or path to a delimited file. However, the config file just wants an array, e.g.,:
Configuring extensions (drivers and plugins)¶
plugin-specific configuration, these live under the
server.plugin properties, respectively. Each driver or plugin will have its own named property,
and the values of any specific configuration it provides are under this. For example:
The above configuration corresponds to the
--driver-xcuitest-webkit-debug-proxy-port CLI argument.
All properties are case-sensitive and will be in
callback-port is allowed, but
callbackPort is not.