I’m trying to run Appium from the command line, so i was following this tutorial : Start and Stop Appium Server Programmatically
mAppiumService = AppiumDriverLocalService.buildService(new AppiumServiceBuilder() .usingDriverExecutable(new File(appiumNodeFile)) .withAppiumJS(new File(appiumJSFile)) .withIPAddress(mAppiumServerAddress).usingPort(mAppiumServerPort));
where appiumNodeFile = C:/Program Files (x86)/Appium/node.exe
appiumJSFile = C:/Program Files (x86)/Appium/node_module/appium/bin/appium.js
and mAppiumService is an AppiumDriverLocalService object
I was trying for hours to launch it form the command line ,
Im getting the following error,
Invalid server instance exception has occured: The invalid appium node C:\Program Files (x86)\Appium\node_module\appium\bin\appium.js has been defined
I also set the JS file to C:/Program Files (x86)/Appium/node_module/appium/lib/server/main.js
Found that post unable-to-start-appium-service-by-appiumdriverlocalserivce it did not help me much.
everything is located within Appium folder under C:\Program Files(x86)\Appium
I use maven , I’ve tried both running it from IDE and CMD, got the same error.
NodeJS is already installed.