Appium configuration being ignored?

In package.json, I have something like this:

 "appium":{
  "server": {
    "address": "127.0.0.1",
    "allow-cors": true,
    "base-path": "/",
    "callback-address": "127.0.0.1",
    "callback-port": 4723,
    "debug-log-spacing": true,
    "default-capabilities": {
      "key": "value"
    },
     "driver": {
      "xcuitest": {
        "key": "value"
      }
    },
    "keep-alive-timeout": 600,
    "local-timezone": true,
    "log": "C:\\Users\\<username>\\projectname\\appium.log",
    "log-level": "info",
    "log-no-colors": false,
    "log-timestamp": true,
    "long-stacktrace": false,
    "no-perms-check": false,
    "nodeconfig": {
      "key": "value"
    },

Among others, my expectation was that a log file will be created in C:\Users\\projectname\appium.log and the server will always be started with the address 127.0.0.1. Instead, appium always starts with the default server 0.0.0.0 and no log file is created there.

It would be helpful if you would cite whatever documentation you are using, and then point out where things are going wrong.

If you want to use package.json, you need to add Appium to your very own NPM package, more info here:

You don’t say that you are creating your own NPM package, and it’s probably unlikely. What you probably want is to use the Appium Config File:

Note that if you want Appium to find it automatically, name it

.appiumrc.json

There is a DOT at the beginning of the filename.

1 Like

Thanks. I created a .appiumrc.json config file and that worked.

1 Like