Unable to launch safari browser even in Simulator: error: Could not prepare mobile safari: Error: Couldn't find built in app in its home or temp dir!

Unable to launch safari in simulator.

My Source code is below:

package com.mob.safari;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;

public class SafariLaunch {
AppiumDriver driver;

@BeforeTest
public void beforeTest() throws MalformedURLException, InterruptedException {

	DesiredCapabilities capabilities = new DesiredCapabilities();
	// capabilities.setCapability("udid",
	// "af5020497b55d10f41a88c488051a85927765a08");
	capabilities.setCapability("deviceName", "iPhone 6");
	capabilities.setCapability("platformName", "iOS");
	capabilities.setCapability(CapabilityType.VERSION, "8.4");
	capabilities.setCapability(CapabilityType.BROWSER_NAME, "Safari");

	URL url = new URL("http", "127.0.0.1", 4723, "/wd/hub");
	driver = new AppiumDriver<WebElement>(url, capabilities) {

		@Override
		public MobileElement scrollToExact(String arg0) {
			// TODO Auto-generated method stub
			return null;
		}

		@Override
		public MobileElement scrollTo(String arg0) {
			// TODO Auto-generated method stub
			return null;
		}
	};
	driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

}

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

@AfterTest
public void afterTest() {

}

}

Error Logs showing:

info: Welcome to Appium v1.3.1 (REV 1160ce02bb89c354cb99317985123acf39f0e7d3)

info: Appium REST http interface listener started on 127.0.0.1:4723

info: [debug] Non-default server args: {“address”:“127.0.0.1”,“safari”:true,“deviceName”:“iPhone 6”,“browserName”:“Safari”,“showSimulatorLog”:true,“defaultCommandTimeout”:7200}
warn: Deprecated server args: {"–show-sim-log":“use instead: --show-ios-log”}
info: Console LogLevel: debug

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

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.1”,“revision”:“1160ce02bb89c354cb99317985123acf39f0e7d3”}}}

info: <-- GET /wd/hub/status 200 5.424 ms - 104 {“status”:0,“value”:{“build”:{“version”:“1.3.1”,“revision”:“1160ce02bb89c354cb99317985123acf39f0e7d3”}}}

info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.1”,“revision”:“1160ce02bb89c354cb99317985123acf39f0e7d3”}}}

info: <-- GET /wd/hub/status 200 1.437 ms - 104 {“status”:0,“value”:{“build”:{“version”:“1.3.1”,“revision”:“1160ce02bb89c354cb99317985123acf39f0e7d3”}}}

info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.1”,“revision”:“1160ce02bb89c354cb99317985123acf39f0e7d3”}}}
info: <-- GET /wd/hub/status 200 0.857 ms - 104 {“status”:0,“value”:{“build”:{“version”:“1.3.1”,“revision”:“1160ce02bb89c354cb99317985123acf39f0e7d3”}}}

info: --> POST /wd/hub/session {“desiredCapabilities”:{“browserName”:“Safari”,“platformName”:“iOS”,“deviceName”:“iPhone 6”,“version”:“8.4”}}

info: Client User-Agent string: Apache-HttpClient/4.5.1 (Java/1.8.0_60)

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. : version
info: [debug] Configuring Safari session
info: [debug] Creating new appium session a0846f05-f982-499f-aa99-ba4630a42ec1
info: [debug] Removing any remaining instruments sockets
info: [debug] Cleaned up instruments socket /tmp/instruments_sock
info: [debug] Setting Xcode folder

info: [debug] Setting Xcode version

info: [debug] Setting iOS SDK Version

info: [debug] Getting sdk version from xcrun with a timeout

info: [debug] iOS SDK Version set to 8.4

info: [debug] Checking whether instruments supports our device string
info: [debug] Getting list of devices instruments supports

info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments

info: [debug] Getting device string from opts: {“forceIphone”:false,“forceIpad”:false,“xcodeVersion”:“6.4”,“iOSSDKVersion”:“8.4”,“deviceName”:“iPhone 6”,“platformVersion”:null}

info: [debug] fixDevice is on
info: [debug] Final device string is: ‘iPhone 6 (8.4 Simulator)’
info: [debug] iOS sim UDID is F6C90FEA-E092-46EC-9C5D-ABFE4DF3DA84
info: [debug] Trying to use mobile safari, version null
info: [debug] Looking for built in app MobileSafari

warn: App is also not at /tmp/Appium-MobileSafari-null.app

error: Could not prepare mobile safari: Error: Couldn’t find built in app in its home or temp dir!

info: [debug] Cleaning up appium session
info: [debug] Error: Couldn’t find built in app in its home or temp dir!
at /Applications/Appium2.app/Contents/Resources/node_modules/appium/lib/devices/ios/simulator.js:442:21
at Object.oncomplete (fs.js:107:15)
info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Couldn’t find built in app in its home or temp dir!)”,“origValue”:“Couldn’t find built in app in its home or temp dir!”},“sessionId”:null}
info: <-- POST /wd/hub/session 500 547.809 ms - 224

error: Failed to start an Appium session, err was: Error: Couldn’t find built in app in its home or temp dir!

Please help me resolve this issue

Thanks,
sanoj

Hmm, there’s a couple of things here possibly to try.
Forewarning: I have not run any Mobile Safari tests on the simulator. I have recently run them on an iphone without fail.

Things to note:

  1. When starting appium (node), I append the --safari flag.
  2. I noticed that you do not have an app parameter in your desired capabilities. I list app = "./apps/SafariLauncher.ipa" in there. This SafariLauncher.ipa was downloaded from github and provisioned with my company’s standard provisioning so it works on our devices.
  3. Make sure developer mode is turned on in your Safari preferences so that the remote debugger port is open.
  4. If you are using the simulator or a real device, you MUST run Safari before attempting to use Appium.

A couple of documentation references. You probably know this already, but just in case:

  1. http://appium.io/slate/en/master/?ruby#example > Automating mobile web apps
  2. Mobile Web automation on iOS real device – Safari
  3. https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/mobile-web.md

Thanks for the reply @shermaneric

I have done > appium --safari
It is working for me for simulator. My case is different I am running the appium server via program as below:

List argumentList = new ArrayList();
argumentList.add(exePath);
argumentList.add(jsPath);
argumentList.add("–address");
argumentList.add(hostUrl);
argumentList.add("–port");
argumentList.add(port);
if (logPath != null && !logPath.trim().equals("")) {
argumentList.add("–log");
argumentList.add(logPath);
}
if (browser.equalsIgnoreCase(“safari”)) {
argumentList.add("–safari");
}
argumentList.add("–no-reset");

		ProcessBuilder pb = new ProcessBuilder(argumentList);
		Process p = pb.start();

This is starting the appium server successfully but unable to find the built in application. I tried the same as > appium --safari. Done for simulator. Getting the following error:

[TestNG] Running:
/Users/sanoj/Documents/workspace/RVSAutomationTestScripts/testng.xml

Starting Appium Server…
e[36minfoe[39m: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d)
e[36minfoe[39m: Appium REST http interface listener started on 0.0.0.0:50353
e[36minfoe[39m: [debug] Non-default server args: {“port”:50353,“noReset”:true,“safari”:true}
Appium Successfuly Started…
Loading Driver…
org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Couldn’t find built in app MobileSafari in its home or temp dir!) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 733 milliseconds
Build info: version: ‘2.48.2’, revision: ‘41bccdd’, time: ‘2015-10-09 19:59:12’
System info: host: ‘Sanojs-Mac-mini.local’, ip: ‘172.16.2.243’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.11’, java.version: ‘1.8.0_60’
Driver info: com.rvsautomation.base.AutomationBase$1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:647)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:247)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:129)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:142)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:37)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:160)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:168)
at com.rvsautomation.base.AutomationBase$1.(AutomationBase.java:271)
at com.rvsautomation.base.AutomationBase.loadAppiumCapabilities(AutomationBase.java:271)
at com.rvsautomation.base.AutomationBase.startAppiumServer(AutomationBase.java:168)
at com.rvsautomation.base.AutomationBase.startAppium(AutomationBase.java:77)
at com.testscripts.nativeapp.FirstTest.setUp(FirstTest.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:510)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:211)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
at org.testng.TestRunner.beforeRun(TestRunner.java:648)
at org.testng.TestRunner.run(TestRunner.java:616)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:359)
at org.testng.SuiteRunner.access$000(SuiteRunner.java:39)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:393)
at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
com.rvsautomation.exception.AutomationException: org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Couldn’t find built in app MobileSafari in its home or temp dir!) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 733 milliseconds
Build info: version: ‘2.48.2’, revision: ‘41bccdd’, time: ‘2015-10-09 19:59:12’
System info: host: ‘Sanojs-Mac-mini.local’, ip: ‘172.16.2.243’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.11’, java.version: ‘1.8.0_60’
Driver info: com.rvsautomation.base.AutomationBase$1
at com.rvsautomation.base.AutomationBase.loadAppiumCapabilities(AutomationBase.java:294)
at com.rvsautomation.base.AutomationBase.startAppiumServer(AutomationBase.java:168)
at com.rvsautomation.base.AutomationBase.startAppium(AutomationBase.java:77)
at com.testscripts.nativeapp.FirstTest.setUp(FirstTest.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:510)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:211)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
at org.testng.TestRunner.beforeRun(TestRunner.java:648)
at org.testng.TestRunner.run(TestRunner.java:616)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:359)
at org.testng.SuiteRunner.access$000(SuiteRunner.java:39)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:393)
at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Couldn’t find built in app MobileSafari in its home or temp dir!) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 733 milliseconds
Build info: version: ‘2.48.2’, revision: ‘41bccdd’, time: ‘2015-10-09 19:59:12’
System info: host: ‘Sanojs-Mac-mini.local’, ip: ‘172.16.2.243’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.11’, java.version: ‘1.8.0_60’
Driver info: com.rvsautomation.base.AutomationBase$1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:647)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:247)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:129)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:142)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:37)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:160)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:168)
at com.rvsautomation.base.AutomationBase$1.(AutomationBase.java:271)
at com.rvsautomation.base.AutomationBase.loadAppiumCapabilities(AutomationBase.java:271)
… 21 more
com.rvsautomation.exception.AutomationException: com.rvsautomation.exception.AutomationException: org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Couldn’t find built in app MobileSafari in its home or temp dir!) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 733 milliseconds
Build info: version: ‘2.48.2’, revision: ‘41bccdd’, time: ‘2015-10-09 19:59:12’
System info: host: ‘Sanojs-Mac-mini.local’, ip: ‘172.16.2.243’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.11’, java.version: ‘1.8.0_60’
Driver info: com.rvsautomation.base.AutomationBase$1
at com.rvsautomation.base.AutomationBase.startAppiumServer(AutomationBase.java:179)
at com.rvsautomation.base.AutomationBase.startAppium(AutomationBase.java:77)
at com.testscripts.nativeapp.FirstTest.setUp(FirstTest.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:510)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:211)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
at org.testng.TestRunner.beforeRun(TestRunner.java:648)
at org.testng.TestRunner.run(TestRunner.java:616)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:359)
at org.testng.SuiteRunner.access$000(SuiteRunner.java:39)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:393)
at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.rvsautomation.exception.AutomationException: org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Couldn’t find built in app MobileSafari in its home or temp dir!) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 733 milliseconds
Build info: version: ‘2.48.2’, revision: ‘41bccdd’, time: ‘2015-10-09 19:59:12’
System info: host: ‘Sanojs-Mac-mini.local’, ip: ‘172.16.2.243’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.11’, java.version: ‘1.8.0_60’
Driver info: com.rvsautomation.base.AutomationBase$1
at com.rvsautomation.base.AutomationBase.loadAppiumCapabilities(AutomationBase.java:294)
at com.rvsautomation.base.AutomationBase.startAppiumServer(AutomationBase.java:168)
… 20 more
Caused by: org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Couldn’t find built in app MobileSafari in its home or temp dir!) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 733 milliseconds
Build info: version: ‘2.48.2’, revision: ‘41bccdd’, time: ‘2015-10-09 19:59:12’
System info: host: ‘Sanojs-Mac-mini.local’, ip: ‘172.16.2.243’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.11’, java.version: ‘1.8.0_60’
Driver info: com.rvsautomation.base.AutomationBase$1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:647)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:247)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:129)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:142)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:37)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:160)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:168)
at com.rvsautomation.base.AutomationBase$1.(AutomationBase.java:271)
at com.rvsautomation.base.AutomationBase.loadAppiumCapabilities(AutomationBase.java:271)
… 21 more
com.rvsautomation.exception.AutomationException: com.rvsautomation.exception.AutomationException: com.rvsautomation.exception.AutomationException: org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Couldn’t find built in app MobileSafari in its home or temp dir!) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 733 milliseconds
Build info: version: ‘2.48.2’, revision: ‘41bccdd’, time: ‘2015-10-09 19:59:12’
System info: host: ‘Sanojs-Mac-mini.local’, ip: ‘172.16.2.243’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.11’, java.version: ‘1.8.0_60’
Driver info: com.rvsautomation.base.AutomationBase$1
at com.rvsautomation.base.AutomationBase.startAppium(AutomationBase.java:80)
at com.testscripts.nativeapp.FirstTest.setUp(FirstTest.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:510)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:211)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
at org.testng.TestRunner.beforeRun(TestRunner.java:648)
at org.testng.TestRunner.run(TestRunner.java:616)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:359)
at org.testng.SuiteRunner.access$000(SuiteRunner.java:39)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:393)
at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.rvsautomation.exception.AutomationException: com.rvsautomation.exception.AutomationException: org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Couldn’t find built in app MobileSafari in its home or temp dir!) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 733 milliseconds
Build info: version: ‘2.48.2’, revision: ‘41bccdd’, time: ‘2015-10-09 19:59:12’
System info: host: ‘Sanojs-Mac-mini.local’, ip: ‘172.16.2.243’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.11’, java.version: ‘1.8.0_60’
Driver info: com.rvsautomation.base.AutomationBase$1
at com.rvsautomation.base.AutomationBase.startAppiumServer(AutomationBase.java:179)
at com.rvsautomation.base.AutomationBase.startAppium(AutomationBase.java:77)
… 19 more
Caused by: com.rvsautomation.exception.AutomationException: org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Couldn’t find built in app MobileSafari in its home or temp dir!) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 733 milliseconds
Build info: version: ‘2.48.2’, revision: ‘41bccdd’, time: ‘2015-10-09 19:59:12’
System info: host: ‘Sanojs-Mac-mini.local’, ip: ‘172.16.2.243’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.11’, java.version: ‘1.8.0_60’
Driver info: com.rvsautomation.base.AutomationBase$1
at com.rvsautomation.base.AutomationBase.loadAppiumCapabilities(AutomationBase.java:294)
at com.rvsautomation.base.AutomationBase.startAppiumServer(AutomationBase.java:168)
… 20 more
Caused by: org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Couldn’t find built in app MobileSafari in its home or temp dir!) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 733 milliseconds
Build info: version: ‘2.48.2’, revision: ‘41bccdd’, time: ‘2015-10-09 19:59:12’
System info: host: ‘Sanojs-Mac-mini.local’, ip: ‘172.16.2.243’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.11’, java.version: ‘1.8.0_60’
Driver info: com.rvsautomation.base.AutomationBase$1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:647)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:247)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:129)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:142)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:37)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:160)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:168)
at com.rvsautomation.base.AutomationBase$1.(AutomationBase.java:271)
at com.rvsautomation.base.AutomationBase.loadAppiumCapabilities(AutomationBase.java:271)
… 21 more

===============================================
Suite
Total tests run: 1, Failures: 0, Skips: 1
Configuration Failures: 1, Skips: 1

Please let me know if there any solution to it.

Ah, ok.
Tracking this down, I found a github post and the area of the code base where your error occurs (see end of post)

It appears that the Safari Location could not be recognized. In the posts, this excerpt is mentioned as a workaround (It also mentions reinstalling Xcode)

@ngochoan1011 : workaround:: on a hunch, I copied the MobileSafari.app app from
```/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/Applications to /tmp and renamed to Appium-MobileSafari-null.app and safari launches now.

Hope this helps you!
Thanks,
Eric


https://github.com/appium/appium/blob/master/lib/devices/ios/simulator.js#L484