# Failed to start session; iOS w/Settings

**URL:** <https://discuss.appium.io/t/failed-to-start-session-ios-w-settings/30760>\
**Category:** Support\
**Created:** [May 21, 2020, 6:09pm UTC](https://discuss.appium.io/t/failed-to-start-session-ios-w-settings/30760 "2020-05-21T18:09:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cory-Berg](https://discuss.appium.io/letter_avatar_proxy/v4/letter/c/65b543/32.png) [@Cory-Berg](https://discuss.appium.io/u/Cory-Berg)\
**Post date:** [May 21, 2020, 6:09pm UTC](https://discuss.appium.io/t/failed-to-start-session-ios-w-settings/30760/1 "2020-05-21T18:09:59Z")

</div>

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](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](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

---

<div class="post-metadata">

**Author:** ![Cory-Berg](https://discuss.appium.io/letter_avatar_proxy/v4/letter/c/65b543/32.png) [@Cory-Berg](https://discuss.appium.io/u/Cory-Berg)\
**Post date:** [May 21, 2020, 6:46pm UTC](https://discuss.appium.io/t/failed-to-start-session-ios-w-settings/30760/2 "2020-05-21T18:46:49Z")

</div>

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.
