This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
21 / 45
Jan 2016

As there are a lot of us facing issues with Safari browser automation, I wanted to document the steps that
help the members to do the browser automation.

  1. Pre-requisites:
    a. Xcode installed on Mac OS X.
    b. Device added to Apple developer program
    c. Get SafariLauncher.app(https://github.com/budhash/SafariLauncher1.9k)
    d. Launch the SafariLauncher.app on connected device from Xcode.
    e. Install appium (IDE)
    f. Download appium from github (https://github.com/appium/appium380)
    g. Install ios-webkit-debug-proxy … use below command from terminal.
    Install brew install ios-webkit-debug-proxy

  2. a. Connect the device to your mac and verify the device is shown under Xcode
    b. Launch the app on device from xcode

  3. Open appium IDE, add your device details as mentioned in the below screen.

  1. launch ios_webkit_debug_proxy from terminal

  2. Open new terminal window and navigate to your cloned appium source and
    run the command ./bin/ios-webkit-debug-proxy-launcher.js -cUDID -d (This is workaround for dubug proxy crash)

Launch the appium from IDE

You are all set to run your test now.

Below is the standalone TestNG/java file to open google home page.

package vin.automation;

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.ios.IOSDriver;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class VinWebTest {
AppiumDriver driver;
DesiredCapabilities capabilities = new DesiredCapabilities();

@BeforeClass()
public void init() throws MalformedURLException {
	capabilities.setCapability("platformName", "iOS");
	capabilities.setCapability("deviceName", "iPhone 5s");
	capabilities.setCapability("browser", "safari");
	driver = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"),
			capabilities);
	driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}

@Test
public void googleTest() {
	driver.get("http://www.google.com");
}

}

Please let me know if you face any issues, Happy coding.

Thanks,
Amarnath Rayudu

  • created

    Jun '15
  • last reply

    Feb '19
  • 44

    replies

  • 44.1k

    views

  • 34

    users

  • 11

    likes

  • 11

    links

Frequent Posters

There are 44 replies with an estimated read time of 11 minutes.

Hi Amarnath,
Really appreciate your initiative. This will definitely help our community and mobile world.

Thanks,
Donald

1 month later

Hi Amarnath ,

Thanks for sharing the information.
After configuring everything I am not able to laucnh URL using "driver.get("http://www.google.com");"

can you please help me out?

Thanks,
Amol

1 month later

Hi @Mobile_Test_Test ,
We are also doing automation on real device on iOS on safari, but test execution is not stable. We face issues with stale tabs which remain in the browser in case a script fails. Now we are facing an issue when we try to click an element which opens a new tab. As soon as new tab is opened we see an issue in appium server- The target application appears to have died. Do you have any idea about this issue ?

1 month later

Hi All,

I have gone through the above the Pre-requisites and I have done the same set up but I got stuck @ one step.

These things I have already done - SafariLauncher is installed via XCODE on IPAD Mini Air (9.3) and device is also connected using os-webkit-debug-proxy.

But when I am running test I am getting below exception

==================================================

info: [debug] Error: ENOENT, stat '/Applications/Appium.app/Contents/Resources/node_modules/appium/build/SafariLauncher/SafariLauncher.zip'
at Error (native)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: ENOENT, stat '/Applications/Appium.app/Contents/Resources/node_modules/appium/build/SafariLauncher/SafariLauncher.zip')","errno":-2,"code":"ENOENT","path":"/Applications/Appium.app/Contents/Resources/node_modules/appium/build/SafariLauncher/SafariLauncher.zip","origValue":"ENOENT, stat '/Applications/Appium.app/Contents/Resources/node_modules/appium/build/SafariLauncher/SafariLauncher.zip'"},"sessionId":null}

error: Failed to start an Appium session, err was: Error: ENOENT, stat '/Applications/Appium.app/Contents/Resources/node_modules/appium/build/SafariLauncher/SafariLauncher.zip'

info: <-- POST /wd/hub/session 500 162.301 ms - 498

===========================================

Can anyone guide me here ??

Thanks & Regards
Mukesh

Download XCode and Install it. After installation import the SafariLauncher in xcode and Run it.

Once build is successful, it will installed SafariLauncher in your device

Friends, I did all my setup. That is setting up Safari Launcher and webkit proxy as well. The problem is when I start the test Safari Launcher starts and opens up the browser but no URL launches. Just the apple.com page launches.

The same test runs well on Simulator.

Hey @yukonpd, you should launch the url from your test scripts, not the SafariLauncher.
If you would like to change the first launched page from the SafariLauncher, you should open it with Xcode and change the Default Value of Root.plist

Thanks @mferturk for your reply,
I launched the URL from the test scripts itself, below is the snippet:

Web driver class{

  private WebDriver setMobileDriver(Map<String, String> selConfig) {

        DesiredCapabilities cap = new DesiredCapabilities();
	String [] appiumDeviceConfig = selConfig.get("mobileDevice").split(":"); 
	cap.setCapability("deviceName", appiumDeviceConfig[0]);
	cap.setCapability("automationName", "Appium");
	cap.setCapability("platformName", "iOS");
	String appiumServerHostUrl = selConfig.get("appiumServer");
	URL appiumServerHost = null;
	try {
		appiumServerHost = new URL(appiumServerHostUrl);
	} catch (MalformedURLException e) {
		e.printStackTrace();
	}
	cap.setJavascriptEnabled(true);
	System.out.println(appiumServerHostUrl);
	AppiumDriver driver=new IOSDriver(appiumServerHost, cap);
	
	try {
		Thread.sleep(30000);
		System.out.println("now entering url");
	} catch (InterruptedException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	driver.get("https://google.com");

Just to remind the same lines work on the Simulator, I have appium 3.1.0 version under my POM.xml. Just let me know if you need more info.

14 days later

Hi Friends,

My mobile application is a iOS Native app. Please go through the below steps
1. After Launching the app there is a button called Forgot Your PIN
2. When we click on Forgot Your PIN button.
3. The application will redirect to a Safari Web page where I have the below fields.
4. Mobile Number, Last Name and Data of Birth Picker.
5. I am unable to tap or select Mobile Number field by using Tap feature of Safari browser using Appium Inspector.

So please someone help me how to tap or select Mobile number field of a browser.

Hi yukonpd,

I have the same issue with you.
Did you solve it? Could you share for us your solution?

19 days later

Hi Friends,

No till now I did not get any solution, if anything is there i will let you know guys.

Thanking you,
Bhaskar.M

Hi, I am facing issue with safari on real device. SafariLauncher opens the safari browser on device but did not hit my URL.
set following capabilities
deviceUDID= xxxxxx
bundleid= com.apple.mobilesafari
appium-version =1.4.11
browserName =Safari
platformName =iOS
deviceName =iPhone 6
platformVersion =8.4

21 days later

Hi Mukesh,

I got the same error which you were getting earlier, could you please confirm whether you got a solution for this.

info: --> POST /wd/hub/session {"desiredCapabilities":{"appium-version":"1.4.13","platformName":"iOS","deviceName":"Bin_iPhone","udid":"1f789643be7b96813c4d2ae5b037bc27cb1b4a26","bundleId":"com.binoy.safarilauncher","browserName":"safari","version":"8.4.1"}}

info: Client User-Agent string: undefined
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] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : appium-version, version

error: Failed to start an Appium session, err was: Error: ENOENT, stat '/Applications/Appium.app/Contents/Resources/node_modules/appium/build/SafariLauncher/SafariLauncher.zip'

info: [debug] Configuring Safari session
info: [debug] Using local .zip from command line: /Applications/Appium.app/Contents/Resources/node_modules/appium/build/SafariLauncher/SafariLauncher.zip
info: [debug] Copying local zip to tmp dir
info: [debug] Got configuration error, not starting session
info: [debug] Cleaning up appium session
info: [debug] Error: ENOENT, stat '/Applications/Appium.app/Contents/Resources/node_modules/appium/build/SafariLauncher/SafariLauncher.zip'
at Error (native)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: ENOENT, stat '/Applications/Appium.app/Contents/Resources/node_modules/appium/build/SafariLauncher/SafariLauncher.zip')","errno":-2,"code":"ENOENT","path":"/Applications/Appium.app/Contents/Resources/node_modules/appium/build/SafariLauncher/SafariLauncher.zip","origValue":"ENOENT, stat '/Applications/Appium.app/Contents/Resources/node_modules/appium/build/SafariLauncher/SafariLauncher.zip'"},"sessionId":null}
info: <-- POST /wd/hub/session 500 4.849 ms - 498

Thanks
Bin

14 days later

Hi Everyone.

I couldn't understand setp2 , if you can explain in details. rest all i did and my Safari launcher installed on Iphone. I can load it mannualy but when i use Appium to Launch.
1. Server Run without Any Error
2. Mobile asked for Passcode
3. Once Passcode Entered nothing happen- Application Didn't open
4. Server running
5. No Java Errors

Can anyone help please what i am doing wrong.

Thanks

Just to update thread, if anyone got same issue. Removed Passcode from setting and now running perfectly fine

23 days later

Great tutorial/documentation!!!

I recently tried mobile web automation on real iOS device using the following:
OS X Yosemite 10.10.5
Xcode 7.2.1
iOS Device (9.2.1)
Appium (1.4.16)

More importantly, using a free ios development provisioning profile!

See http://goo.gl/nId1rr252 for more details!

9 days later

I have been trying to connect my iPad to mac over wifi to run the appium tests. I know how tests works with android devices over wifi, but not how to do it with iOS devices. Please update if any one has worked on how to get it done.

1 month later

Hi Mukesh,

I am facing this issue now. Could you please share me your solution to this issue.
Original error: ENOENT, stat '/Applications/Appium.app/Contents/Resources/node_modules/appium/build/SafariLauncher/SafariLauncher.zip'

1 month later

Scenario
I got Selenium server running on windows machine
Appium on mac mini with iPhone 6 Plus connected to it
Also installed SafariLauncher on device and everything seems setup with Xcode

Automation tests enabled on device
Can connect with Appium to node so connection seems fine

When i run the tests i get this errors on appium, any help?
These are the logs i get

Appium] Appium REST http interface listener started on 10.14.0.164:4723

[HTTP] --> GET /wd/hub/status {}

[MJSONWP] Calling AppiumDriver.getStatus() with args: []

[MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.5.2","revision":null}}

[HTTP] <-- GET /wd/hub/status 200 18 ms - 83

[debug] [Appium] Appium successfully registered with the grid on 10.14.0.141:4444

[HTTP] --> GET /wd/hub/status {}

[MJSONWP] Calling AppiumDriver.getStatus() with args: []

[MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.5.2","revision":null}}

[HTTP] <-- GET /wd/hub/status 200 13 ms - 83

[HTTP] --> GET /wd/hub/status {}

[MJSONWP] Calling AppiumDriver.getStatus() with args: []

[MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.5.2","revision":null}}
[HTTP] <-- GET /wd/hub/status 200 8 ms - 83

[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"browser":"Safari","name":"Behat feature suite","browserName":"Safari","ignoreZoomSetting":false,"platformName":"iOS","deviceName":"dsgiPhone","version":"latest","platform":"iOS","tags":["BRNOLPT-DEV28","PHP 5.6.15"]}}

[MJSONWP] Calling AppiumDriver.createSession() with args: [{"browser":"Safari","name":"Behat feature suite","browserName":"Safari","ignoreZoomSetting":false,"platformName":"iOS","deviceName":"dsgiPhone","v...

[Appium] Creating new IosDriver session
[Appium] Capabilities:
[Appium] browser: 'Safari'
[Appium] name: 'Behat feature suite'
[Appium] browserName: 'Safari'
[Appium] ignoreZoomSetting: false
[Appium] platformName: 'iOS'
[Appium] deviceName: 'dsgiPhone'
[Appium] version: 'latest'
[Appium] platform: 'iOS'
[Appium] tags: [ 'BRNOLPT-DEV28', 'PHP 5.6.15' ]
[Appium] platformVersion: '9.3'
[Appium] udid: 'b388ca681aec75ba40c2520949ca1df59a44334b'
[Appium] showIOSLog: true

[BaseDriver] The following capabilities were provided, but are not recognized by appium: browser, name, ignoreZoomSetting, version, platform, tags.
[BaseDriver] Session created with session id: 92e9e06e-d7aa-44f7-a907-afb6d6c37376
[debug] [iOS] Not auto-detecting udid.
[debug] [iOS] Creating iDevice object with udid b388ca681aec75ba40c2520949ca1df59a44334b

[debug] [iOS] Checking for presence of SafariLauncher at '/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/build/SafariLauncher/SafariLauncher.app'

[debug] [iOS] SafariLauncher does not exist

[debug] [iOS] SafariLauncher not found, building...
[iOS] Cleaning SafariLauncher

[debug] [iOS] Cleaning SafariLauncher for iphoneos9.3

[iOS] Finished cleaning SafariLauncher

[iOS] Updating config for Safari Launcher

[iOS] Building SafariLauncher
[debug] [iOS] Building SafariLauncher for iphoneos9.3
[HTTP] --> GET /wd/hub/status {}
[MJSONWP] Calling AppiumDriver.getStatus() with args: []

[iOS] Error: Command 'xcodebuild -sdk iphoneos9.3 -xcconfig /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/safari-launcher/build.xcconfig' exited with code 65
at ChildProcess. (lib/teen_process.js:65:19)
at emitTwo (events.js:100:13)
at ChildProcess.emit (events.js:185:7)
at maybeClose (internal/child_process.js:850:16)
at Process.ChildProcess.handle.onexit (internal/childprocess.js:215:5)
{ [Error: Command 'xcodebuild -sdk iphoneos9.3 -xcconfig /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/safari-launcher/build.xcconfig' exited with code 65]
stdout: 'Build settings from command line:\n SDKROOT = iphoneos9.3\n\nBuild settings from configuration file \'/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/safari-launcher/build.xcconfig\':\n BUNDLE_ID = com.bytearc.SafariLauncher\n IDENTITY_CODE = \n IDENTITY_NAME = iPhone Developer\n\n=== BUILD TARGET SafariLauncher OF PROJECT SafariLauncher WITH THE DEFAULT CONFIGURATION (Release) ===\n\nCheck dependencies\nCode Sign error: No matching provisioning profiles found: No provisioning profiles with a valid signing identity (i.e. certificate and private key pair) matching the bundle identifier “com.bytearc.SafariLauncher” were found.\n\n',
stderr: '** BUILD FAILED **\n\n\nThe following build commands failed:\n\tCheck dependencies\n(1 failure)\n',
code: 65 }

[iOS] Error: Command 'xcodebuild -sdk iphoneos9.3 -xcconfig /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/safari-launcher/build.xcconfig' exited with code 65
at ChildProcess. (lib/teen_process.js:65:19)
at emitTwo (events.js:100:13)
at ChildProcess.emit (events.js:185:7)
at maybeClose (internal/child_process.js:850:16)
at Process.ChildProcess.handle.onexit (internal/childprocess.js:215:5)
{ [Error: Command 'xcodebuild -sdk iphoneos9.3 -xcconfig /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/safari-launcher/build.xcconfig' exited with code 65]
stdout: 'Build settings from command line:\n SDKROOT = iphoneos9.3\n\nBuild settings from configuration file \'/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/safari-launcher/build.xcconfig\':\n BUNDLE_ID = com.bytearc.SafariLauncher\n IDENTITY_CODE = \n IDENTITY_NAME = iPhone Developer\n\n=== BUILD TARGET SafariLauncher OF PROJECT SafariLauncher WITH THE DEFAULT CONFIGURATION (Release) ===\n\nCheck dependencies\nCode Sign error: No matching provisioning profiles found: No provisioning profiles with a valid signing identity (i.e. certificate and private key pair) matching the bundle identifier “com.bytearc.SafariLauncher” were found.\n\n',
stderr: '** BUILD FAILED **\n\n\nThe following build commands failed:\n\tCheck dependencies\n(1 failure)\n',
code: 65 }
[iOS] Bad app: '/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/build/SafariLauncher/SafariLauncher.app'. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name.

[MJSONWP] Encountered internal error running command: Error: Bad app: /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/build/SafariLauncher/SafariLauncher.app. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name.
at IosDriver.configureApp$ (lib/driver.js:250:13)
at tryCatch (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as throw
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at run (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:104:47)
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:115:28
at flush (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/$.microtask.js:19:5)
at combinedTickCallback (internal/process/nexttick.js:67:7)
at process.tickCallback (internal/process/nexttick.js:98:9)

[HTTP] <-- POST /wd/hub/session 500 3416 ms - 410

[MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.5.2","revision":null}}
[HTTP] <-- GET /wd/hub/status 200 843 ms - 83

any help please...fighting with this for days

these lines concern me the most
[debug] [iOS] Not auto-detecting udid.
[debug] [iOS] Creating iDevice object with udid b388ca681aec75ba40c2520949ca1df59a44334b

[debug] [iOS] Checking for presence of SafariLauncher at '/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/build/SafariLauncher/SafariLauncher.app'

if the device is connected why trying to launch the SafariLaucher.app from my mac mini????thanks

thanks

18 days later

I'm experiencing the exact same issue as pintod02 above is experiencing. Since the update to Appium 1.5.2(which ironically, states in the bugfixes that it fixes this exact issue), it seems Appium is trying to reinstall SafariLauncher, rather than use the one already installed.

[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"SafariLauncher","platformVersion":"9.3.2","browserName":"Safari","platformName":"iOS","udid":"341028a6bdab23e3b255d85e2303195f861b2073","deviceName":"iPhone"}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"SafariLauncher","platformVersion":"9.3.2","browserName":"Safari","platformName":"iOS","udid":"341028a6bdab23e3b255d85e2303195f861b2073","d...
[Appium] Creating new IosDriver session
[Appium] Capabilities:
[Appium] app: 'SafariLauncher'
[Appium] platformVersion: '9.3.2'
[Appium] browserName: 'Safari'
[Appium] platformName: 'iOS'
[Appium] udid: '341028a6bdab23e3b255d85e2303195f861b2073'
[Appium] deviceName: 'iPhone'
[BaseDriver] Session created with session id: d0278bc9-9f01-4b2b-8bd5-48c6af6fb1cb
[debug] [iOS] Not auto-detecting udid.
[debug] [iOS] Creating iDevice object with udid 341028a6bdab23e3b255d85e2303195f861b2073
[debug] [iOS] Checking for presence of SafariLauncher at '/usr/local/lib/node_modules/appium/node_modules/appium-ios-driver/build/SafariLauncher/SafariLauncher.app'
[debug] [iOS] SafariLauncher does not exist
[debug] [iOS] SafariLauncher not found, building...
[iOS] Cleaning SafariLauncher
[debug] [iOS] Cleaning SafariLauncher for iphoneos9.3
[iOS] Finished cleaning SafariLauncher
[iOS] Updating config for Safari Launcher
[iOS] Building SafariLauncher
[debug] [iOS] Building SafariLauncher for iphoneos9.3
[iOS] Error: Command 'xcodebuild -sdk iphoneos9.3 -xcconfig /usr/local/lib/node_modules/appium/node_modules/appium-ios-driver/node_modules/safari-launcher/build.xcconfig' exited with code 65
at ChildProcess. (lib/teen_process.js:65:19)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:850:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
{ Error: Command 'xcodebuild -sdk iphoneos9.3 -xcconfig /usr/local/lib/node_modules/appium/node_modules/appium-ios-driver/node_modules/safari-launcher/build.xcconfig' exited with code 65
at ChildProcess. (lib/teen_process.js:65:19)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:850:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
stdout: 'Build settings from command line:\n SDKROOT = iphoneos9.3\n\nBuild settings[HTTP] <-- POST /wd/hub/session 500 2932 ms - 381
from configuration file \'/usr/local/lib/node_modules/appium/node_modules/appium-ios-driver/node_modules/safari-launcher/build.xcconfig\':\n BUNDLE_ID = com.bytearc.SafariLauncher\n IDENTITY_CODE = \n IDENTITY_NAME = iPhone Developer\n\n=== BUILD TARGET SafariLauncher OF PROJECT SafariLauncher WITH THE DEFAULT CONFIGURATION (Release) ===\n\nCheck dependencies\nCode Sign error: No matching provisioning profiles found: No provisioning profiles with a valid signing identity (i.e. certificate and private key pair) matching the bundle identifier “com.bytearc.SafariLauncher” were found.\n\n',
stderr: '** BUILD FAILED **\n\n\nThe following build commands failed:\n\tCheck dependencies\n(1 failure)\n',
code: 65 }
[iOS] Error: Command 'xcodebuild -sdk iphoneos9.3 -xcconfig /usr/local/lib/node_modules/appium/node_modules/appium-ios-driver/node_modules/safari-launcher/build.xcconfig' exited with code 65
at ChildProcess. (lib/teen_process.js:65:19)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:850:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
{ Error: Command 'xcodebuild -sdk iphoneos9.3 -xcconfig /usr/local/lib/node_modules/appium/node_modules/appium-ios-driver/node_modules/safari-launcher/build.xcconfig' exited with code 65
at ChildProcess. (lib/teen_process.js:65:19)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:850:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
stdout: 'Build settings from command line:\n SDKROOT = iphoneos9.3\n\nBuild settings from configuration file \'/usr/local/lib/node_modules/appium/node_modules/appium-ios-driver/node_modules/safari-launcher/build.xcconfig\':\n BUNDLE_ID = com.bytearc.SafariLauncher\n IDENTITY_CODE = \n IDENTITY_NAME = iPhone Developer\n\n=== BUILD TARGET SafariLauncher OF PROJECT SafariLauncher WITH THE DEFAULT CONFIGURATION (Release) ===\n\nCheck dependencies\nCode Sign error: No matching provisioning profiles found: No provisioning profiles with a valid signing identity (i.e. certificate and private key pair) matching the bundle identifier “com.bytearc.SafariLauncher” were found.\n\n',
stderr: '** BUILD FAILED **\n\n\nThe following build commands failed:\n\tCheck dependencies\n(1 failure)\n',
code: 65 }
[iOS] Bad app: '/usr/local/lib/node_modules/appium/node_modules/appium-ios-driver/build/SafariLauncher/SafariLauncher.app'. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name.
[MJSONWP] Encountered internal error running command: Error: Bad app: /usr/local/lib/node_modules/appium/node_modules/appium-ios-driver/build/SafariLauncher/SafariLauncher.app. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name.
at IosDriver.configureApp$ (lib/driver.js:250:13)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as throw
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at process._tickCallback (internal/process/next_tick.js:103:7)

Can you please let us know following details on which your steps worked for you -

OSX version
Appium.app Version
iOS version(real or simulator device)

20 days later

hi

you also need to use remotewebdriver when running web browser automation on real device(import org.openqa.selenium.remote.RemoteWebdriver;

RemoteWebdriver driver =new RemoteWebdriver(new URL("http://127.0.0.1:4723/wd/hub"),
capabilities);

Hi

you also have to use selenium remoteWebdriver (import org.openqa.selenium.remote.RemoteWebDriver;)

driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), cap);

Hi All,

We have to perform automation on iOS real device. We have performed all the steps mentioned at the top but while running our test case, we are getting bad app error for safari launcher. It says safari launcher app is not present under appium.

How do we get that. We just installed appium and run the code.

We hit with the same error code 65 .. Please help

[BaseDriver] The following capabilities were provided, but are not recognized by appium: version, platform.
[BaseDriver] Session created with session id: 148d4958-689c-4a0a-801b-d3c1e89d42b5
[debug] [iOS] Not auto-detecting udid.
[debug] [iOS] Creating iDevice object with udid 824e504af3797828af9f9d88583c831af65df1a1

[debug] [iOS] Checking for presence of SafariLauncher at '/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/build/SafariLauncher/SafariLauncher.app'

[debug] [iOS] SafariLauncher does not exist
[debug] [iOS] SafariLauncher not found, building...
[iOS] Cleaning SafariLauncher
[debug] [iOS] Cleaning SafariLauncher for iphoneos9.0

[iOS] Finished cleaning SafariLauncher

[iOS] Updating config for Safari Launcher
[iOS] Building SafariLauncher

[debug] [iOS] Building SafariLauncher for iphoneos9.0

[iOS] Error: Command 'xcodebuild -sdk iphoneos9.0 -xcconfig /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/safari-launcher/build.xcconfig' exited with code 65
at ChildProcess. (lib/teen_process.js:65:19)
at emitTwo (events.js:100:13)
at ChildProcess.emit (events.js:185:7)
at maybeClose (internal/child_process.js:850:16)
at Process.ChildProcess.handle.onexit (internal/childprocess.js:215:5)
{ [Error: Command 'xcodebuild -sdk iphoneos9.0 -xcconfig /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/safari-launcher/build.xcconfig' exited with code 65]
stdout: 'Build settings from command line:\n SDKROOT = iphoneos9.0\n\nBuild settings from configuration file \'/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/safari-launcher/build.xcconfig\':\n BUNDLE_ID = com.bytearc.SafariLauncher\n IDENTITY_CODE = \n IDENTITY_NAME = iPhone Developer\n\n=== BUILD TARGET SafariLauncher OF PROJECT SafariLauncher WITH THE DEFAULT CONFIGURATION (Release) ===\n\nCheck dependencies\nCode Sign error: No matching provisioning profiles found: No provisioning profiles matching an applicable signing identity were found.\n\n',
stderr: '** BUILD FAILED **\n\n\nThe following build commands failed:\n\tCheck dependencies\n(1 failure)\n',
code: 65 }

[iOS] Error: Command 'xcodebuild -sdk iphoneos9.0 -xcconfig /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/safari-launcher/build.xcconfig' exited with code 65
at ChildProcess. (lib/teen_process.js:65:19)
at emitTwo (events.js:100:13)
at ChildProcess.emit (events.js:185:7)
at maybeClose (internal/child_process.js:850:16)
at Process.ChildProcess.handle.onexit (internal/childprocess.js:215:5)
{ [Error: Command 'xcodebuild -sdk iphoneos9.0 -xcconfig /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/safari-launcher/build.xcconfig' exited with code 65]
stdout: 'Build settings from command line:\n SDKROOT = iphoneos9.0\n\nBuild settings from configuration file \'/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/safari-launcher/build.xcconfig\':\n BUNDLE_ID = com.bytearc.SafariLauncher\n IDENTITY_CODE = \n IDENTITY_NAME = iPhone Developer\n\n=== BUILD TARGET SafariLauncher OF PROJECT SafariLauncher WITH THE DEFAULT CONFIGURATION (Release) ===\n\nCheck dependencies\nCode Sign error: No matching provisioning profiles found: No provisioning profiles matching an applicable signing identity were found.\n\n',
stderr: '** BUILD FAILED **\n\n\nThe following build commands failed:\n\tCheck dependencies\n(1 failure)\n',
code: 65 }

Hi yukonpd,

I am facing the same issue as discussed by you above.
Did you find a solution for that...........if so ..could u plz share the solution??

Thanks in Advance.

Hi AmarnathRayudu,

I did all the above mentioned setup but problem is when I start the test,Safari Launcher starts and opens up the browser but no URL launches. Just the apple.com page launches.

Could u plz suggest me some solution.

Thanks in Advance

1 month later

For anyone who is facing the issue as @yukonpd, @Hung_Pham mentioned. The safari launcher was able to launch safari browser but navigate url did not work.
I could resolve using autowebview capability. Here is what i do from java. Hopefully this will help.

capabilities.setCapability(MobileCapabilityType.UDID ,"*************");
capabilities.setCapability(MobileCapabilityType.APP, System.getProperty("user.dir")+"/src/test/java/Library/SafariLauncher.app");

capabilities.setCapability(MobileCapabilityType.AUTO_WEBVIEW, "TRUE");

15 days later

Can anyone elaborate the step "Launch the SafariLauncher.app on connected device from Xcode".
Actually how to do this?

28 days later

Hey @Rajlaxmi_Parida,

You should open the SafariLauncher.app in Xcode as a iOS application project after you download it from github (https://github.com/budhash/SafariLauncher).
Then you need to connect your iOS device to your computer and select as target device from Xcode.
Build the SafariLauncher.app on the target device from Xcode.

3 months later

same issue unable to resolve can anyone help on this

2 months later

Hello All,

How to kill all the opened safari windows before launching safari browser on iPhad devices using appium. The problem i am getting is ,Safari browser is launching with SafariLauncher ,I am not able close all the remaining opened browsers and launching browser with default google page even I have changed in root.plist file default url .

I am unable delete cookie and kill safari browser in between suite of test execution.

Environment:
Xcode:7.1
iPad Air: 8.3
Appium 1.6.3

Please help me out resolving this issue.

Thanks in advance.

Regards,
Prasad