Appium Server 1.7.1 keeps restarting simulator and appium after running script to launch application on simulator

Hi All,

I’m trying to open an app on simulator using Appium server 1.7.1
I have created the .app file using Xcode 8.2.1
Mac OS X version 10.11.6 (15G31)

When I run the script, the app is opened on simulator, but after sometime, the simulator is closed and new appium desktop app is opened and again simulator is opened. This endless loop is stopped when we stop the script and stop the appium server which is running. Below is my Java code which I’m running

package DemoApplicationTest;

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

import org.openqa.selenium.remote.DesiredCapabilities;

import com.thoughtworks.selenium.Wait;

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.ios.IOSDriver;
import io.appium.java_client.remote.MobileCapabilityType;

public class LaunchApplication {

public static void main(String args[]) throws Exception
{
	AppiumDriver driver;
	
	DesiredCapabilities capabilities = new DesiredCapabilities();
	capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone 6");
	capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "iOS");
	capabilities.setCapability(MobileCapabilityType.VERSION, "9.3");
	capabilities.setCapability(MobileCapabilityType.APP, "/Users/techm/Documents/UICatalog.app");
	driver = new IOSDriver(new URL("http://0.0.0.0:4723/wd/hub"),capabilities);
	
	driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
	
	driver.close();
}

}

Please help

At the end of it, I’m getting this error
Exception in thread “main” org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: We exceeded the number of retries allowed for instruments to successfully start; failing launch (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 212.20 seconds
Build info: version: ‘2.53.0’, revision: ‘35ae25b’, time: ‘2016-03-15 16:57:40’
System info: host: ‘MacBook-Air.local’, ip: ‘127.0.0.1’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.11.6’, java.version: ‘1.8.0_112’
Driver info: io.appium.java_client.ios.IOSDriver
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:423)
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:678)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:40)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:144)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:36)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:114)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:132)
at io.appium.java_client.ios.IOSDriver.(IOSDriver.java:82)
at DemoApplicationTest.LaunchApplication.main(LaunchApplication.java:26)