Whenever I launch my script through eclipse simulator will be launched and application will installed but once launch the aplication launched applications is getting crashed or Instruments is getting crashed(im not able to proceede further) simulator will

Hello all,
I am working on:

  • Mac Mini with OS version 10.10.
  • Xcode 6.0
  • Appium Version 1.3.4

whenever I launch my script through eclipse simulator will be launched and application will installed but once launch the aplication launched applications is getting crashed or Instruments is getting crashed(im not able to proceede further) simulator will closed and reopened
Application used to work fine with In the previous versions of appium but now its not working as expected

My DesiredCapabilities are as follows
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“appium-version”,“1.3.4”);
capabilities.setCapability(“platformName”, “iOS”);
capabilities.setCapability(“platformVersion”, “8.0”);
capabilities.setCapability(“deviceName”, “iPhone 5”);
capabilities.setCapability(“app”, “/Users/***/Desktop/.app”);

Below is logs attached from eclipse Junit console(Im running script as Junit script)

org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Instruments crashed on startup) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 92.79 seconds
Build info: version: ‘2.43.0’, revision: ‘accb3003b9fb8f7cae30f9669b4c594a065396a6’, time: ‘2014-09-09 22:22:51’
System info: host: ‘sncradms-Mac-mini-5.local’, ip: ‘10.16.16.163’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.10’, java.version: ‘1.8.0_25’
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:408)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:180)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:126)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:153)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:109)
at io.appium.java_client.ios.IOSDriver.(IOSDriver.java:23)
at com.sncr.auto.pages.WLSyncDriveLogin.preRequisites(WLSyncDriveLogin.java:29)
at com.sncr.auto.tests.provFlow.setUp(provFlow.java:37)
at junit.framework.TestCase.runBare(TestCase.java:139)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)


logs from Terminal


[debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.4”,“revision”:“c8c79a85fbd6870cd6fc3d66d038a115ebe22efe”}}}
info: <-- GET /wd/hub/status 200 4.692 ms - 104 {“status”:0,“value”:{“build”:{“version”:“1.3.4”,“revision”:“c8c79a85fbd6870cd6fc3d66d038a115ebe22efe”}}}
info: --> POST /wd/hub/session {“desiredCapabilities”:{“app”:"/Users//Desktop/SyncDrive.app",“appium-version”:“1.3.4”,“platformVersion”:“8.0”,“platformName”:“iOS”,“deviceName”:“iPhone 5”}}
info: Client User-Agent string: Apache-HttpClient/4.3.4 (java 1.5)
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
info: [debug] Using local app from desired caps: /Users/
/Desktop/SyncDrive.app
info: [debug] Creating new appium session 2473f4fd-412e-4091-9db7-474ccb9aa193
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.0
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.0”,“iOSSDKVersion”:“8.0”,“deviceName”:“iPhone 5”,“platformVersion”:“8.0”}
info: [debug] fixDevice is on
info: [debug] Final device string is: ‘iPhone 5 (8.0 Simulator)’
info: [debug] iOS sim UDID is E251EB92-FFF4-4A75-A0BD-E48F849AE78D
info: [debug] Detecting automation tracetemplate
info: [debug] Not auto-detecting udid, running on sim
info: [debug] Parsed app Info.plist (as binary)
info: [debug] Parsed app Localizable.strings
info: [debug] Getting bundle ID from app
info: [debug] Parsed app Info.plist (as binary)
info: [debug] Creating instruments
info: On some xcode 6 platforms, instruments-without-delay does not work. If you experience this, you will need to re-run appium with the --native-instruments-lib flag
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/
/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {“nodePath”:"/usr/local/Cellar/node/0.10.36/bin/node",“commandProxyClientPath”:"/usr/local/lib/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js",“instrumentsSock”:"/tmp/instruments_sock",“interKeyDelay”:null,“justLoopInfinitely”:false,“autoAcceptAlerts”:false,“sendKeyStrategy”:“oneByOne”}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. D…ot manually modify!
info: [debug] Dynamic bootstrap path: /Users/
/Library/Application Support/appium/bootstrap/bootstrap-1fb90a0f7e596c1d.js
info: [debug] Reusing dynamic bootstrap: /Users/
/Library/Application Support/appium/bootstrap/bootstrap-1fb90a0f7e596c1d.js
info: [debug] Getting device string from opts: {“forceIphone”:false,“forceIpad”:false,“xcodeVersion”:“6.0”,“iOSSDKVersion”:“8.0”,“deviceName”:“iPhone 5”,“platformVersion”:“8.0”}
info: [debug] fixDevice is on
info: [debug] Final device string is: ‘iPhone 5 (8.0 Simulator)’
info: [debug] We’re on iOS7.1+ so forcing defaultDevice on
info: [debug] Getting device string from opts: {“forceIphone”:false,“forceIpad”:false,“xcodeVersion”:“6.0”,“iOSSDKVersion”:“8.0”,“deviceName”:“iPhone 5”,“platformVersion”:“8.0”}
info: [debug] fixDevice is on
info: [debug] Final device string is: ‘iPhone 5 (8.0 Simulator)’
info: [debug] Parsed app Info.plist (as binary)
info: [debug] Wrote new app Info.plist with device type
info: [debug] Checking whether we need to set app preferences
info: [debug] Running ios sim reset flow
info: [debug] Killing the simulator process
info: [debug] Killall iOS Simulator
info: [debug] Killing any other simulator daemons
info: [debug] Cleaning sim data files
info: [debug] Executing: xcrun simctl erase E251EB92-FFF4-4A75-A0BD-E48F849AE78D
info: [debug] Cleaning app data files
warn: Applications directory /Users//Library/Developer/CoreSimulator/Devices/E251EB92-FFF4-4A75-A0BD-E48F849AE78D/data/Containers/Data/Application doesn’t exist. Have you run this simulator before?
warn: Applications directory /Users/
/Library/Developer/CoreSimulator/Devices/E251EB92-FFF4-4A75-A0BD-E48F849AE78D/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] Not setting locale
info: [debug] No iOS / app preferences to set
info: [debug] Starting iOS 8.
simulator log capture
info: [debug] Not pre-launching simulator
info: [debug] No device id or app, not installing to real device.
info: [debug] Starting command proxy.
info: [debug] Instruments socket server started at /tmp/instruments_sock
info: [debug] Starting instruments
info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
info: Launching instruments
info: [debug] Attempting to run app on iPhone 5 (8.0 Simulator)
info: [debug] Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w “iPhone 5 (8.0 Simulator)” /Users/
/Desktop/SyncDrive.app -e UIASCRIPT "/Users//Library/Application Support/appium/bootstrap/bootstrap-1fb90a0f7e596c1d.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {“DYLD_INSERT_LIBRARIES”:"/usr/local/lib/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd6/InstrumentsShim.dylib",“LIB_PATH”:"/usr/local/lib/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd6"}
info: [debug] And launch timeouts (in ms): {“global”:90000}
info: [debug] [INST] Waiting for device to boot…
info: [debug] [INST] 2015-02-10 12:00:04 +0000 Fail: Could not start script, target application is not frontmost.
info: [debug] [INST] Instruments Trace Complete (Duration : 35.328396s; Output : /tmp/appium-instruments/instrumentscli0.trace)
info: [debug] [INSTSERVER] Instruments exited with code 0
info: [debug] Killall instruments
info: [debug] Instruments crashed on startup
info: [debug] Attempting to retry launching instruments, this is retry #1
info: [debug] Killall iOS Simulator
info: Launching instruments
info: [debug] Attempting to run app on iPhone 5 (8.0 Simulator)
info: [debug] Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w “iPhone 5 (8.0 Simulator)” /Users/
/Desktop/SyncDrive.app -e UIASCRIPT "/Users//Library/Application Support/appium/bootstrap/bootstrap-1fb90a0f7e596c1d.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {“DYLD_INSERT_LIBRARIES”:"/usr/local/lib/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd6/InstrumentsShim.dylib",“LIB_PATH”:"/usr/local/lib/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd6"}
info: [debug] And launch timeouts (in ms): {“global”:90000}
info: [debug] [INST] Waiting for device to boot…
info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 8.) : Failed to launch process with bundle identifier ‘com.synchronoss.cloudtest’
info: [debug] [INSTSERVER] Instruments exited with code 253
info: [debug] Killall instruments
info: [debug] Instruments crashed on startup
info: [debug] Attempting to retry launching instruments, this is retry #2
info: [debug] Got the FBSOpenApplicationError, not killing the sim but leaving it open so the app will launch
info: Launching instruments
info: [debug] Attempting to run app on iPhone 5 (8.0 Simulator)
info: [debug] Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w “iPhone 5 (8.0 Simulator)” /Users//Desktop/SyncDrive.app -e UIASCRIPT "/Users//Library/Application Support/appium/bootstrap/bootstrap-1fb90a0f7e596c1d.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {“DYLD_INSERT_LIBRARIES”:"/usr/local/lib/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd6/InstrumentsShim.dylib",“LIB_PATH”:"/usr/local/lib/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd6"}
info: [debug] And launch timeouts (in ms): {“global”:90000}
info: [debug] [INST] 2015-02-10 12:00:46 +0000 Fail: Could not start script, target application is not frontmost.
info: [debug] [INST] Instruments Trace Complete (Duration : 33.130211s; Output : /tmp/appium-instruments/instrumentscli0.trace)
info: [debug] [INSTSERVER] Instruments exited with code 0
info: [debug] Killall instruments
info: [debug] Instruments crashed on startup
info: [debug] Attempting to retry launching instruments, this is retry #3
info: [debug] Killall iOS Simulator
info: Launching instruments
info: [debug] Attempting to run app on iPhone 5 (8.0 Simulator)
info: [debug] Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w “iPhone 5 (8.0 Simulator)” /Users/
/Desktop/SyncDrive.app -e UIASCRIPT "/Users//Library/Application Support/appium/bootstrap/bootstrap-1fb90a0f7e596c1d.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {“DYLD_INSERT_LIBRARIES”:"/usr/local/lib/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd6/InstrumentsShim.dylib",“LIB_PATH”:"/usr/local/lib/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd6"}
info: [debug] And launch timeouts (in ms): {“global”:90000}
info: [debug] [INST] Waiting for device to boot…
info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 8.) : Failed to launch process with bundle identifier ‘com.synchronoss.cloudtest’
info: [debug] [INSTSERVER] Instruments exited with code 253
info: [debug] Killall instruments
info: [debug] Instruments crashed on startup
info: [debug] We exceeded the number of retries allowed for instruments to successfully start; failing launch
info: [debug] Stopping iOS log capture
info: [debug] Running ios sim reset flow
info: [debug] Killing the simulator process
info: [debug] Killall iOS Simulator
info: [debug] Killing any other simulator daemons
info: [debug] Cleaning sim data files
info: [debug] Executing: xcrun simctl erase E251EB92-FFF4-4A75-A0BD-E48F849AE78D
info: [debug] Executing: xcrun simctl erase E251EB92-FFF4-4A75-A0BD-E48F849AE78D
info: [debug] Cleaning app data files
warn: Applications directory /Users/
/Library/Developer/CoreSimulator/Devices/E251EB92-FFF4-4A75-A0BD-E48F849AE78D/data/Containers/Data/Application doesn’t exist. Have you run this simulator before?
warn: Applications directory /Users/
*******/Library/Developer/CoreSimulator/Devices/E251EB92-FFF4-4A75-A0BD-E48F849AE78D/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 Instruments.onInstrumentsExit (/usr/local/lib/node_modules/appium/node_modules/appium-instruments/lib/instruments.js:387:31)
at null. (/usr/local/lib/node_modules/appium/node_modules/appium-instruments/lib/instruments.js:308:12)
at ChildProcess.emit (events.js:98:17)
at Process.ChildProcess._handle.onexit (child_process.js:820: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 92645.957 ms - 182

Can anyone Please help me to get rid of this ??Any help will appreciated!!

Make sure .app is build specifically for simulator, not real device.

You can my video for configuration
Appium Tutorial-IOS Configuration on mac: http://youtu.be/BULjgsTpw2c

I’m sure I build it for Simulator only and some times its working fine.In 10 attempts 1 time its working fine

1 Like

I Ran My Script Once again but still facing same issue

Appium logs
[INST] Waiting for device to boot… info: [debug] [INST] 2015-02-12 08:21:07 +0000 Fail: Could not start script, target application is not frontmost. info: [debug] [INST] Instruments Trace Complete (Duration : 35.470001s; Output : /tmp/appium-instruments/instrumentscli0.trace)

[INST] Waiting for device to boot…
info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 8.) : Failed to launch process with bundle identifier 'com..

**

logs from eclipse(Im running it as Junit Script)

**
org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Instruments crashed on startup) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 88.51 seconds
Build info: version: ‘2.43.0’, revision: ‘accb3003b9fb8f7cae30f9669b4c594a065396a6’, time: ‘2014-09-09 22:22:51’
System info: host: ‘sncradms-Mac-mini-5.local’, ip: ‘10.16.15.55’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.10’, java.version: ‘1.8.0_25’
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)

Hello All,
I am also facing this issue on Iphone 6 Simulator…
Did anyone got a solution to this?

Thanks,
Nishant Shah

Hi Team,

There might be multiple reason because of that you are getting the above error, please follow the below step.

1.Build the project for the same simulator on which you are going to run automation.
2.Upgrade your X code version according to iOS version.
3.Open the Xcode then minimize the Xcode , then run your execution.

I believe it will help.