0
votes

Am using Java code to start Appium server using Command Line Agruments mentioning a specific port in it.Am looking currently how to start the appium server with using available ports in windows machine.

2
have you installed using node.js command prompt or you have install appium server - akshay patil
Using node.js By taking reference from Method 2 mentioned in automationtestinghub.com/… - Saravanan M

2 Answers

0
votes

If you have installed the appium using node js then you can start using following command

appium -a 127.0.0.1 -p 4723

If you have download the .exe file then you have to open the executable file and it will show you like this..

enter image description here

then you have to click the start appium server button and if the server start sucessfully then it will look like this..

enter image description here

0
votes

To start appium service without providing any port, you can use AppiumDriverLocalService class and AppiumServiceBuilder. We will use method 'usingAnyFreePort()' which Configures the appium server to start on any available port. Node.js should be installed on system to achieve it.

We need to provide path of Appium node.exe file path and appium.js file path as below :

    String Appium_Node_Path="C:\Program Files\nodejs\node.exe";

                //Appium.js file can be available on one of these 2 path
    String Appium_JS_Path="C:\Program Files (x86)\Appium\resources\app\node_modules\appium\build\lib/appium.js";

             OR          

    String Appium_JS_Path="C:\Users\username\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\lib\appium.js";
     AppiumDriverLocalService appiumService";

appiumService = AppiumDriverLocalService.buildService(new AppiumServiceBuilder().usingAnyFreePort().usingDriverExecutable(new File(Appium_Node_Path)).withAppiumJS(new File(Appium_JS_Path)));
    appiumService.start();