Travis CI - Unable to remove port forward Error executing adbExec

Viewed 1294

I am trying to setup automated tests for an android app using Appium (npm version) but I keep getting the error

[UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: UnknownError: An unknown server-side error occurred while processing the command. Original error: Trying to proxy a session command without session id [UiAutomator2] Unable to remove port forward 'Error executing adbExec. Original error: 'Command '/usr/local/android-sdk/platform-tools/adb -P 5037 -s emulator-5554 forward --remove tcp\:8200' exited with code 1'; Stderr: 'error: listener 'tcp:8200' not found'; Code: '1''

I have looked around google for ages but havnt been able to find any solution that has actually worked for me, so far totalling 50 failed builds.

If i run the commands on my local machine it works fine but within travis I have no such luck unfortunately. I am new to setting up appium so it could be something minor im not understanding.

A gist of my travis.yml file is here

Distribution: Distributor ID: Ubuntu Description: Ubuntu 14.04.5 LTS Release: 14.04 Codename: trusty

Thanks in advance.

2 Answers

tcp:8200 is not forwarded and there should be no forwards.

try with adb forward --remove-all, when not knowing which port it is

... if it's even required to remove any forward.

After looking at the logs, I understand that the emulator is not ready to allow UiAutomator to get deployed properly.

So to make sure that emulator is ready, you can use avdLaunchTimeout and avdReadyTimeout by passing 60000 ms to both in your desired capabilities.

Once the emulator is ready, you won't get this error.

Related