Cant Launch Safari on Simulator Get error: Could not determine iOS SDK version info: [debug] Error: Command failed: /bin/sh -c xcrun --sdk iphonesimulator --show-sdk-version

Hey All,
I get this error when running an iOS simulator script.
It doesn’t load the Safari browser on the iOS simulator and stops the script with this error.
Does anyone know how to fix this issue?
Thanks.

Exception in thread “main” org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Command failed: /bin/sh -c xcrun --sdk iphonesimulator --show-sdk-version
) (WARNING: The server did not provide any stacktrace information)

info: [debug] Creating new appium session 868f1127-e0a8-4dd2-9084-7e4141922313

info: [debug] Removing any remaining instruments sockets

info: [debug] Cleaned up instruments socket /tmp/instruments_sock

info: [debug] Setting Xcode version

info: [debug] Xcode version set to 7.0.1

info: [debug] Setting iOS SDK Version

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“88e67ce987d78ce44de252219e07dc176a3511c2”},“isShuttingDown”:false},“sessionId”:“868f1127-e0a8-4dd2-9084-7e4141922313”}
info: <-- GET /wd/hub/status 200 1.463 ms - 179 {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“88e67ce987d78ce44de252219e07dc176a3511c2”},“isShuttingDown”:false},“sessionId”:“868f1127-e0a8-4dd2-9084-7e4141922313”}

info: [debug] Cleaning up appium session

error: Could not determine iOS SDK version

info: [debug] Error: Command failed: /bin/sh -c xcrun --sdk iphonesimulator --show-sdk-version

at ChildProcess.exithandler (child_process.js:751:12)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

error: Failed to start an Appium session, err was: Error: Command failed: /bin/sh -c xcrun --sdk iphonesimulator --show-sdk-version

info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Command failed: /bin/sh -c xcrun --sdk iphonesimulator --show-sdk-version\n)”,“cause”:{“killed”:true,“code”:null,“signal”:“SIGTERM”,“cmd”:"/bin/sh -c xcrun --sdk iphonesimulator --show-sdk-version"},“isOperational”:true,“killed”:true,“code”:null,“signal”:“SIGTERM”,“cmd”:"/bin/sh -c xcrun --sdk iphonesimulator --show-sdk-version",“origValue”:“Command failed: /bin/sh -c xcrun --sdk iphonesimulator --show-sdk-version\n”},“sessionId”:null}
info: <-- POST /wd/hub/session 500 9308.575 ms - 525

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“88e67ce987d78ce44de252219e07dc176a3511c2”}}}
info: <-- GET /wd/hub/status 200 1.138 ms - 105 {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“88e67ce987d78ce44de252219e07dc176a3511c2”}}}

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“88e67ce987d78ce44de252219e07dc176a3511c2”}}}
info: <-- GET /wd/hub/status 200 0.675 ms - 105 {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“88e67ce987d78ce44de252219e07dc176a3511c2”}}}

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“88e67ce987d78ce44de252219e07dc176a3511c2”}}}
info: <-- GET /wd/hub/status 200 0.698 ms - 105 {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“88e67ce987d78ce44de252219e07dc176a3511c2”}}}

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“88e67ce987d78ce44de252219e07dc176a3511c2”}}}
info: <-- GET /wd/hub/status 200 0.935 ms - 105 {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“88e67ce987d78ce44de252219e07dc176a3511c2”}}}

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“88e67ce987d78ce44de252219e07dc176a3511c2”}}}
info: <-- GET /wd/hub/status 200 0.653 ms - 105 {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“88e67ce987d78ce44de252219e07dc176a3511c2”}}}

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“88e67ce987d78ce44de252219e07dc176a3511c2”}}}
info: <-- GET /wd/hub/status 200 0.771 ms - 105 {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“88e67ce987d78ce44de252219e07dc176a3511c2”}}}

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“88e67ce987d78ce44de252219e07dc176a3511c2”}}}
info: <-- GET /wd/hub/status 200 0.659 ms - 105 {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“88e67ce987d78ce44de252219e07dc176a3511c2”}}}

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“88e67ce987d78ce44de252219e07dc176a3511c2”}}}
info: <-- GET /wd/hub/status 200 0.822 ms - 105 {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“88e67ce987d78ce44de252219e07dc176a3511c2”}}}

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“88e67ce987d78ce44de252219e07dc176a3511c2”}}}
info: <-- GET /wd/hub/status 200 1.612 ms - 105 {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“88e67ce987d78ce44de252219e07dc176a3511c2”}}}

info: --> POST /wd/hub/session {“desiredCapabilities”:{“app”:“safari”,“platformName”:“iOS”,“deviceName”:“iPhone 6”,“platformVersion”:“9.0”}}

info: Client User-Agent string: Apache-HttpClient/4.4.1 (Java/1.8.0_60)
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***

info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: [debug] Configuring Safari session
info: [debug] We’re on iOS8+ so not copying mobile safari app
info: [debug] Creating new appium session df61b545-adf4-4d3b-a374-aabc163c4df4
info: [debug] Removing any remaining instruments sockets

info: [debug] Cleaned up instruments socket /tmp/instruments_sock

info: [debug] Setting Xcode version

error: Could not determine iOS SDK version

info: [debug] Xcode version set to 7.0.1
info: [debug] Setting iOS SDK Version
info: [debug] Cleaning up appium session
info: [debug] undefined
info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Command failed: /bin/sh -c xcrun --sdk iphonesimulator --show-sdk-version\n)”,“cause”:{“killed”:true,“code”:null,“signal”:“SIGTERM”,“cmd”:"/bin/sh -c xcrun --sdk iphonesimulator --show-sdk-version"},“isOperational”:true,“killed”:true,“code”:null,“signal”:“SIGTERM”,“cmd”:"/bin/sh -c xcrun --sdk iphonesimulator --show-sdk-version",“origValue”:“Command failed: /bin/sh -c xcrun --sdk iphonesimulator --show-sdk-version\n”},“sessionId”:null}
info: <-- POST /wd/hub/session 500 96.128 ms - 525

error: Failed to start an Appium session, err was: Error: Command failed: /bin/sh -c xcrun --sdk iphonesimulator --show-sdk-version

I am also facing the same error-
Using Xcode =6.1
SDK =8.1
Appium =1.4.13

On launching safari from eclipse giving same error posted above

Check out this post. Someone said that they check Use Native Instruments Library in IOS Advance Settings on the Appium GUI and it allowed the simulator to work and pass the error. This person also said the 8.4 simulator should run fine without this workaround. I haven’t tried this yet with the 9.1 ios simulator that was giving me the error initially with appium 1.4.13. I can’t promise it will work, but you can give it a try. Let us know if it works.

unchecking Native Instruments worked for me :slight_smile:

1 Like

I am trying to inspect element using Appium Desktop App for iOS App on iPhone 6.
Appium Capabilities which i am using through appium inspector are :-
{
“bundleId”: “com.speridian.Eaton.c360”,
“deviceName”: “iPhone 6”,
“platformName”: “iOS”,
“platformVersion”: “12.1.4”,
“udid”: “7eedc71d241ccc5xxxxxxxxxxxxxxxxxxxxxxxxx”,
“app”: “/Users/sunnym/Desktop/Eaton/Eaton.Mobile.C360_1.0.432.ipa”,
“newCommandTimeout”: “60”
}
Above capabilities are mentioned in Appium.
When i try to start a appium inspector session getting above error:-
Could not determine iOS SDK version: Command ‘xcrun --sdk iphonesimulator --show-sdk-version’ timed out after 15000ms
[XCUITest] at Object.wrappedLogger.errorAndThrow (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-support/lib/logging.js:78:13)
[XCUITest] at errorAndThrow (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/utils.js:70:9)
[XCUITest] at process._tickCallback (internal/process/next_tick.js:68:7)
[XCUITest] Error: Could not determine iOS SDK version: Command ‘xcrun --sdk iphonesimulator --show-sdk-version’ timed out after 15000ms
[XCUITest] at Object.wrappedLogger.errorAndThrow (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-support/lib/logging.js:78:13)
[XCUITest] at errorAndThrow (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/utils.js:70:9)
[XCUITest] at process._tickCallback (internal/process/next_tick.js:68:7)
[BaseDriver] Event ‘newSessionStarted’ logged at 1558512736554 (13:42:16 GMT+0530 (IST))

Xcode version is 10
Can anyone help me on this
@seleniumappiumnewbie