Start server with arguments stored in json

Hi ,

Is there a way to start appium server with arguments stored in json file
something like --default-capabilities path/to/json ?

Thanks

Command: appium -p 4722 --nodeconfig Configfile.json

Configfile.json:

{
“capabilities”:[
{
“browserName”:“Android”,
“maxInstances”:2,
“deviceName”:“330059b18fd353db”,
“version”:“9.0”,
“platform”:“Android”
}
],
“configuration”:{
“proxy”:“org.openqa.grid.selenium.proxy.DefaultRemoteProxy”,
“cleanUpCycle”:3000,
“port”:“4722”,
“host”:“10.19.196.105”,
“hubHost”:“10.19.196.105”,
“maxSession”:1,
“hubPort”:4444,
“registerCycle”:5000,
“url”:“http://10.19.196.105:4722/wd/hub”,
“nodePolling”:2000,
“timeout”:30000,
“register”:true
}
}

this one is for node (selenium grid) configuration
can I also config an appium server by the same way ?

Yes u can pass default capabilities as json. key name details u will get in appium docs.

Ok ,

I’ve tried to launch it with --nodeconfig as suggested but still couldn’t launch the server with desire flags (port : 1234) , and the server launched with default 4723

{
“configuration”:{
“port”:1234
}
}

Refer this page
http://appium.io/docs/en/writing-running-appium/caps/

It should be either adbPort or systemPort.

Not sure which one you are trying to set as default capability. Just go through the info given in docs.

This is client port (for uiAutomator)

I’m trying to launch appium server with specific flag (for example - port) but the server stiil running on default 4723