I have been trying to set up appium with a couple of android devices on my RHEL box. Installation is complete and I use the following to launch the appium instance for a device.
appium -U xxxxxxx -a 127.0.0.1 -p 4725 -bp 4728 --no-reset
I also have a Java class for handling ui elements where I initialize my Android Driver with the following
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("platformName", "Android");
caps.setCapability("deviceName", "Device");
caps.setCapability("platformVersion", "5.0");
caps.setCapability("udid", "xxxxxxx");
caps.setCapability("appPackage", testAppPkg);
caps.setCapability("appActivity", activityName);
driver = new AndroidDriver(new URL("http://127.0.0.1:4725/wd/hub"), caps);
But on every run, the initialization fails with the following:
[exec] Unhandled error: Error: connect ECONNREFUSED 127.0.0.1:4728
[exec] at Object.exports._errnoException (util.js:874:11)
[exec] at exports._exceptionWithHostPort (util.js:897:20)
When I try to telnet the port locally using
$telnet localhost 4728
it fails with
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host: Connection refused
Is the bootstrap port opened on the device or the host itself. If it is on the host itself, why is appium server not opening (or not being able to open) the port ? Can anyone please help with root causing the issue ? Am I doing something wrong in the initialization ?