0

Friends,

Below error is seen:,the below code launches the simulator and trys to launch the app, but it fails, on the simulator i could obsever,the app launches but kills at the same time, it tries that for 3 try,but eventually failes with the below error

.java file:

import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class testtwo{
public static RemoteWebDriver driver;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
File appDir = new File ("//Users//gangl//Appium//jars");
File app = new File (appDir,"Cars (1).ipa");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("browserName", "");
capabilities.setCapability("platformName", "iOS");
capabilities.setCapability("deviceName", "iPhone 5s");
capabilities.setCapability("platformVersion", "8.4");
capabilities.setCapability("app",app.getAbsolutePath());
capabilities.setCapability("appPackage", "au.com.cars");
capabilities.setCapability("appActivity", "au.com.cars.activity.HomeActivity");
driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}

  @Test
  public void test() {
    System.out.println("Hello");
  }
}

Appium log Error:

info: [debug] Cleaning app data files warn: Applications directory /Users/gangaiahl/Library/Developer/CoreSimulator/Devices/9D2CE961-9A4E-45BC-9E64-A891EA5B978F/data/Containers/Data/Application doesn't exist. Have you run this simulator before?

warn: Applications directory
/Users/gangaiahl/Library/Developer/CoreSimulator/Devices/9D2CE961-9A4E-45BC-9E64-A891EA5B978F/data/Containers/Bundle/Application doesn't exist. Have you run this simulator before?

info: Couldn't find app directories to delete. Probably it's not installed

info: [debug] Cleaning up appium session

error: Failed to start an Appium session, err was: Error: Instruments crashed on startup

info: [debug] Error: Instruments crashed on startup

at [object Object].Instruments.onInstrumentsExit (/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/lib/instruments.js:440:31) at [object Object]. (/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/lib/instruments.js:353:12)

at ChildProcess.emit (events.js:110:17)

at Process.ChildProcess._handle.onexit (child_process.js:1074:12)

info: [debug] Responding to client with error: {"status":33,"value": {"message":"A new session could not be created. (Original error: Instruments crashed on startup)","origValue":"Instruments crashed on startup"},"sessionId":null}

info: <-- POST /wd/hub/session 500 151278.884 ms - 182

Naman
  • 27,789
  • 26
  • 218
  • 353
Lokesh
  • 41
  • 10
  • 1. Are you able to access the `instruments` in ways other than appium script? 2. Also please make sure you have Use `Native Instruments Library` checked under Advance settings for IOS platform in Appium's UI. 3. Enable `UI Automation` setting in setting--developer. Possibly a duplicate of http://stackoverflow.com/questions/35633001/appium-instruments-crashed-on-startup/35646176#35646176 – Naman Mar 09 '16 at 05:17
  • Also, working on iOS following android specific capabilities are of no use : `capabilities.setCapability("appPackage", "au.com.cars"); capabilities.setCapability("appActivity", "au.com.cars.activity.HomeActivity");` – Naman Mar 09 '16 at 05:18
  • @nullpointer, yes the 2 and 3 points is enabled. Will check on the 1st pointer. Also removed the two capabilities which u listed out,even then the same error is seen. One more information, the same error happens when trying to run on the actual devices as well..... – Lokesh Mar 09 '16 at 06:40
  • @nullpointer Did try for the 1st point, yes i am able to run if i compile my xcode project, but we cant open an .ipa file from my simulator. My other question is do we need the File App Dir and path if we are running on simulator ? – Lokesh Mar 09 '16 at 06:47
  • you do need the `file path` and if you could correct the current `appDir` for your existing `.ipa` then we can confirm on the app path. Also I doubt if this is related to the signing of the application if app provided as a parameter is correct. – Naman Mar 09 '16 at 06:55

0 Answers0