Failed to start session; iOS w/Settings

Previously worked on Appium 1.15.1 and non iOS13 devices. Launching settings this way still works on iOS 13 when AUT is provided.

Trying on Appium 1.17.1
iOS 13.2.3

// Reproduction code, using JavaClient 7.3
// Setup the appium session
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.UDID, udid);
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, “iPhone”);
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, “iOS”);
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.IOS_XCUI_TEST);
capabilities.setCapability(“bundleId”, “com.apple.Preferences”);
iosDriver = new IOSDriver(new URL(serverURL), capabilities);

Server log:
2020-05-21 17:54:21:888 - [debug] [WebDriverAgent] WebDriverAgent successfully started after 52473ms
2020-05-21 17:54:21:889 - [debug] [BaseDriver] Event ‘wdaSessionAttempted’ logged at 1590083661889 (12:54:21 GMT-0500 (Central Daylight Time))
2020-05-21 17:54:21:889 - [debug] [XCUITest] Sending createSession command to WDA
2020-05-21 17:54:21:892 - [debug] [WD Proxy] Matched ‘/session’ to command name ‘createSession’
2020-05-21 17:54:21:892 - [debug] [WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8100/session] with body: {“capabilities”:{“firstMatch”:[{“bundleId”:“com.apple.Preferences”,“arguments”:[],“environment”:{},“eventloopIdleDelaySec”:0,“shouldWaitForQuiescence”:true,“shouldUseTestManagerForVisibilityDetection”:false,“maxTypingFrequency”:60,“shouldUseSingletonTestManager”:true}],“alwaysMatch”:{}}}
2020-05-21 17:58:30:152 - [WD Proxy] Got response with status 500: {“value”:{“error”:“session not created”,“message”:“Failed to launch com.apple.Preferences application”,“traceback”:""},“sessionId”:“FEFF5C50-1973-49DA-A98B-35E84B01EC67”}
2020-05-21 17:58:30:153 - [debug] [W3C] Matched W3C error code ‘session not created’ to SessionNotCreatedError
2020-05-21 17:58:30:163 - [debug] [XCUITest] Failed to create WDA session (A new session could not be created. Details: Failed to launch com.apple.Preferences application). Retrying…
2020-05-21 17:58:31:164 - [debug] [BaseDriver] Event ‘wdaSessionAttempted’ logged at 1590083911164 (12:58:31 GMT-0500 (Central Daylight Time))
2020-05-21 17:58:31:165 - [debug] [XCUITest] Sending createSession command to WDA
2020-05-21 17:58:31:166 - [debug] [WD Proxy] Matched ‘/session’ to command name ‘createSession’
2020-05-21 17:58:31:167 - [debug] [WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8100/session] with body: {“capabilities”:{“firstMatch”:[{“bundleId”:“com.apple.Preferences”,“arguments”:[],“environment”:{},“eventloopIdleDelaySec”:0,“shouldWaitForQuiescence”:true,“shouldUseTestManagerForVisibilityDetection”:false,“maxTypingFrequency”:60,“shouldUseSingletonTestManager”:true}],“alwaysMatch”:{}}}

Looking to see if I need to set some other capabilities to make this happen once again?

Best Regards,

Cory

Seems likely it was more of an issue related to previous sessions not being cleaned up appropriately.

Still not certain why session bashing + simple launch preferences would fail to launch the settings app though.