Could not find button to launch Safari. Make sure you are using the latest version of SafariLauncher that appium is using

Hi All,
I’m getting the following error when attempting to launch google on safari on the real iPhone 5 device with iOS 9 using Appium.
Could not find button to launch Safari. Make sure you are using the latest version of SafariLauncher that appium is using

I already followed the instructions here to fix my SafariLauncher already.

Can someone please help me? I’m stuck and I tried to search for an answer online, but couldn’t find any solutions though I’ve seen others have seen this error too.

Thanks for your help.

Appium Logs

info: [debug] Socket data received (7633 bytes)
info: [debug] Socket data being routed.
info: [debug] Got result from instruments: {“status”:0,“value”:{“UIAApplication”:{“@”:{“name”:“Safari”,“label”:“Safari”,“value”:null,“dom”:null,“enabled”:true,“valid”:true,“visible”:true,“hint”:null,“path”:“/0”,“x”:0,“y”:0,“width”:320,“height”:568},“>”:[{“UIAWindow”:{“@”:{“name”:null,“label”:null,“value”:null,“dom”:null,“enabled”:true,"valid

info: [debug] On Safari Launcher. Tapping button to launch Safari
info: [debug] Waiting up to 0ms for condition
info: [debug] Pushing command to appium work queue: “au.getElementByAccessibilityId(‘launch safari’)”
info: [debug] Sending command to instruments: au.getElementByAccessibilityId(‘launch safari’)

info: [debug] [INST] 2015-09-20 03:30:26 +0000 Debug: Got new command 2 from instruments: au.getElementByAccessibilityId(‘launch safari’)

info: [debug] [INST] 2015-09-20 03:30:26 +0000 Debug: evaluating au.getElementByAccessibilityId(‘launch safari’)

info: [debug] [INST] 2015-09-20 03:30:26 +0000 Debug: evaluation finished

info: [debug] [INST] 2015-09-20 03:30:26 +0000 Debug: responding with:

info: [debug] [INST] 2015-09-20 03:30:26 +0000 Debug: Running system command #3: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{“status”:0,“value”:“”}…

info: [debug] Socket data received (25 bytes)

info: [debug] Socket data being routed.
info: [debug] Got result from instruments: {“status”:0,“value”:“”}
info: [debug] Condition unmet after 1113ms. Timing out.

error: Error. Could not find button to launch Safari. Make sure you are using the latest version of SafariLauncher that appium is using

info: [debug] Cleaning up appium session

error: Failed to start an Appium session, err was: Error: Error. Could not find button to launch Safari. Make sure you are using the latest version of SafariLauncher that appium is using

info: [debug] Error: Error. Could not find button to launch Safari. Make sure you are using the latest version of SafariLauncher that appium is using
at [object Object]. (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/safari.js:70:17)
at [object Object]. (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/common.js:77:12)
at [object Object].iOSController.handleFindCb (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/ios-controller.js:313:5)
at [object Object]. (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/ios-controller.js:138:14)
at next (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:798:43)
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:32:16
at [object Object].exports.respond (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/common.js:28:9)
at [object Object]. (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/ios.js:1473:18)
at getResultAndSendNext (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/lib/command-proxy.js:146:20)
at Socket. (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/lib/command-proxy.js:88:7)
at Socket.emit (events.js:129:20)
at _stream_readable.js:908:16
at process._tickDomainCallback (node.js:381:11)
info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Error. Could not find button to launch Safari. Make sure you are using the latest version of SafariLauncher that appium is using)”,“origValue”:“Error. Could not find button to launch Safari. Make sure you are using the latest version of SafariLauncher that appium is using”},“sessionId”:null}
info: ← POST /wd/hub/session 500 28864.386 ms - 378

info: [IOS_SYSLOG_ROW ] Sep 19 20:30:27 Real-iPhone-5 MobileGestaltHelper[84] : libMobileGestalt MobileGestalt.c:272: server_access_check denied access to question UniqueDeviceID for pid 511

Oh, delete the SafariLauncher app from the phone/simulator you are testing on, then run your test using the newest version of Appium. It will install the newest version of SafariLauncher on your phone.

Thanks Jonah. I will upgrade to new version.

I am having same issue. I did removed the SafariLauncher app from my phone(iPhone 6 Plus) before running my test. But that did not work. Could you please help me?
I have Appium Version 1.4.8 (Draco).

Appium Log:

error: Error. Could not find button to launch Safari. Make sure you are using the latest version of SafariLauncher that appium is using

info: [debug] Socket data received (25 bytes)
info: [debug] Socket data being routed.
info: [debug] Got result from instruments: {“status”:0,“value”:""}
info: [debug] Condition unmet after 1240ms. Timing out.
info: [debug] Cleaning up appium session
info: [debug] Error: Error. Could not find button to launch Safari. Make sure you are using the latest version of SafariLauncher that appium is using
at [object Object]. (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/safari.js:70:17)
at [object Object]. (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/common.js:77:12)
at [object Object].iOSController.handleFindCb (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/ios-controller.js:313:5)
at [object Object]. (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/ios-controller.js:138:14)
at next (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:798:43)
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:32:16
at [object Object].exports.respond (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/common.js:28:9)
at [object Object]. (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/ios.js:1473:18)
at getResultAndSendNext (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/lib/command-proxy.js:146:20)
at Socket. (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/lib/command-proxy.js:88:7)
at Socket.emit (events.js:129:20)
at _stream_readable.js:908:16
at process._tickDomainCallback (node.js:381:11)
info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Error. Could not find button to launch Safari. Make sure you are using the latest version of SafariLauncher that appium is using)”,“origValue”:“Error. Could not find button to launch Safari. Make sure you are using the latest version of SafariLauncher that appium is using”},“sessionId”:null}
info: <-- POST /wd/hub/session 500 11563.145 ms - 378

error: Failed to start an Appium session, err was: Error: Error. Could not find button to launch Safari. Make sure you are using the latest version of SafariLauncher that appium is using

@pstha
You can install appium this way to get SafariLauncher on a real iPhone device.
Install Appium from source
-Type git clone https://github.com/appium/appium.git (will get latest copy 1.4.13)
-Type in terminal to find code-signing identity: security find-identity -v -p codesigning
-Type $ ./reset.sh --ios --real-safari --code-sign ‘code signing identity’ --profile ‘retrieved profile identity code’

But I had some issues with the simulator just FYI, but maybe I had a setup issue.
There is a valid SafariLauncher bug where the Appium .dmg version and the installation via npm doesn’t install SafariLauncher. The new bug is entered here https://github.com/appium/appium-dot-app/issues/513