Simulator gets crashed many times

Hello, I am writing test case using java, for ios app. It is taking too much time to launch app in simulator. Also 2-3 times simulator fails/crashes and then app gets installed and then test runs.
Following is the code , please suggest me solution for the same -

import io.appium.java_client.AppiumDriver;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.util.List;

public class AppiumIOSLogin {

private AppiumDriver driver;
public WebDriver dr;
private List<Integer> values;

private static final int MINIMUM = 0;
private static final int MAXIMUM = 10;

public void setupTest() throws Exception {

    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability("platformName", "ios");
    capabilities.setCapability("platformVersion", "8.1");//7.1
    capabilities.setCapability("deviceName", "iPhone Simulator");
    String appPath = "/Users/vivekgabje/Documents/workspace/";
    capabilities.setCapability("app", appPath);
    try {
        driver = new AppiumDriver(new URL(""), capabilities);
    } catch (MalformedURLException e) {
public void SimpleTest () throws Exception
    List<WebElement> elems=driver.findElements(By.className("UIATextField"));
    for (WebElement elem : elems) {
        elem.sendKeys("[email protected]");
    WebElement txt=driver.findElement(By.className("UIASecureTextField"));
    WebElement button1 = driver.findElement(By.xpath("//UIAApplication[1]/UIAWindow[1]/UIAButton[1]"));;

    WebElement lbl=driver.findElement(By.className("UIAStaticText"));       
    WebElement logout = driver.findElement(By.xpath("//UIAApplication[1]/UIAWindow[1]/UIAButton[1]"));;

public void tearDown() {
    if (driver == null)


I am using intelliJ IDEA 14 CE. For Appium set up I have followed following youtube video :