I am doing mobile automation using appium with selenium.
I willing to run the appium server using commands through cmd prompt in windows machine.
Could any one help how to run through cmd prompt and what is the command to run it without clicking launch button in appium.exe.
Please anyone help me.Thanks in advance.
You can do this using Appium Support Library:
<dependency>
<groupId>com.github.genium-framework</groupId>
<artifactId>Appium-Support</artifactId>
<version>1.0.5</version>
</dependency>
You can start the server in your code by doing this:
ServerArguments serverArguments = new ServerArguments();
serverArguments.setArgument("--address", "127.0.0.1");
serverArguments.setArgument("--chromedriver-port", 9516);
serverArguments.setArgument("--bootstrap-port", 4725);
serverArguments.setArgument("--no-reset", true);
serverArguments.setArgument("--local-timezone", true);
_appiumServer = new AppiumServer(serverArguments);
_appiumServer.startServer();
Hope this helps.
You can start the appium server by running the following command
appium & (or) appium --avd emulator_name
- Follow the steps for installing the Node and npm here.
Type
npm install -g appium@1.3.7 #for specific version
npm install -g appium # for the latest version
In case of windows machine Make sure to include the path where you have installed the Appium in your System Environment variable (mine is C:\Users\XXX\AppData\Roaming\npm\node_modules\appium)
After that open a new instance of CMD and launch the appium server with typing "appium" or with the parameters you like.
P.S. It works on OSX, Windows and Linux.
Please install Node.js from http://nodejs.org/download/
Then Clone appium from GitHub or Download appium for windows (that you are currently having)
Open cmd and Navigate/change directory to downloaded appium folder /node_modules/appium/bin.
Run node appium
You can also mention server arguments , refer from below link:
https://github.com/appium/appium/blob/master/docs/en/server-args.md
if the last link is broken, https://github.com/appium/appium/blob/master/docs/en/server-args.md, try this one http://appium.io/slate/en/master/?java#server-flags
For anybody looking for a simple module solution, I've created appium-controller that starts and stops appium in the background programmatically (mac or windows).