

startAppiumServer – This function helps to start the Appium Driver service in both Windows and MAC Operating Systems.getJSPath – This function helps to get the path of the js in both Windows and MAC Operating Systems.getNodePath – This function helps to get the path of installed node in both Windows and MAC Operating Systems.Real devices locally If you run an Appium server on your computer. The port number includes port for Appium server URL, Chrome Driver port, and Bootstrap port. Run tests on emulators Prepare your app for testing and run it on Android. getPort – This function helps to generate random dynamic port number which required to start the Appium service.

Here I defined following private functions to work with this utility, Based on your Appium service availability you can load all the desired capability and send those as a request to Appium Server. Here I am creating the available ports using the ServerSocket class and binding the dynamic port with build service of AppiumDriverLocalService. Using this concept you can start many Appium Server sessions for your automation, especially in case of parallel execution you may need to start the appium servers in different terminals with different ports. This will help to start the Appium Server programmatically in both MAC and Windows OS. In this article introducing the AppiumServiceBuilder functionality built into the Appium Java client.
