iOS13: Connection refused after cleanup

The problem

After updating appium (tried both V1.15 and beta V1.16.0) and Xcode (tried both 11.2 and beta 11.3), the Driver gets a busy port problem:
[DEBUG] [TestEventLogger] [35m[iProxy@00008020]e[39m Error: Connection was refused to port 8100
[DEBUG] [TestEventLogger] [35m[iProxy@00008020]e[39m at Usbmux.connect (/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/node_modules/appium-ios-device/lib/usbmux/index.js:207:13)

I’ve noticed this issue was already discussed (https://github.com/appium/appium/issues/13452), but in my case, the issue occurs although the session ends properly:

Session begins with the following configurations:
“noReset”: false,
“fullReset”: false,
“useNewWDA”: “true

and ends with:
driver.quit();

Environment

  • Appium version: 1.16.0-beta.1
  • Desktop OS/version used to run Appium: macOS 10.14.5
  • Mobile platform/version under test: iOS
  • Real device or emulator/simulator: real iPhone XR 13.2
  • Build using Xcode11.3

Details

How can I make sure deleteSession has been called? Also, I’m not sure this is actually the issue since it also occurred in the first session that I tried, and also after manually cleaning the port.
Issue reproduces constantly (happens 100% of the times).

1 Like

try:

  1. restart mac
  2. start Simulator manually and wait it complete to start
  3. uninstall appium, install and complete config for real device
  4. add more tries to start ios driver with:
capabilities.setCapability(IOSMobileCapabilityType.WDA_STARTUP_RETRIES, 4); // default 2
  1. triple check that “driver.quit();” happens even when test fails!

PS it is mine issue in git :slight_smile:

Can you make sure you are using wdaLocalPort in the desired caps for the wdaport.
and also try killing the server at the exit using exec “kill -9 $(lsof -i tcp:#{$port_global} -t)”