[iOS]Instruments crashed on startup

Appium Version: 1.3.1
Mac OS X: 10.10
Device: iPhone6/iOS8.1
Xcode Version: 6.1

Running testscript with iOS native app I get instruments crash continously after trying many times!
Here is full log:

info: --> POST /wd/hub/session {"desiredCapabilities":{"deviceName":"iPhone","browserName":"","version":"8.1","platformName":"iOS","app":"com.telenavsoftware.doudouy"}}
info: Client User-Agent string: Python-urllib/2.7
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] App is an iOS bundle, will attempt to run as pre-existing
info: [debug] Creating new appium session bf0827b8-878c-444b-ba3e-77737d329769
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.1
info: [debug] Not checking whether simulator is available since we're on a real device
info: [debug] Detecting automation tracetemplate
info: [debug] Not auto-detecting udid, running on sim
info: [debug] Could not parse plist file (as binary) at 
/usr/local/lib/node_modules/appium/com.telenavsoftware.doudouy/en.lproj/Localizable.strings
info: Will try to parse the plist file as XML
info: [debug] Could not parse plist file (as XML) at /usr/local/lib/node_modules/appium/com.telenavsoftware.doudouy/en.    lproj/Localizable.strings
warn: Could not parse app Localizable.strings; assuming it doesn't exist
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/kingson/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {"nodePath":"/usr/local/Cellar/node/0.10.    26/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}
...o: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!
info: [debug] Dynamic bootstrap path: /Users/kingson/Library/Application Support/appium/bootstrap/bootstrap-cf7bfecca051fdad.js
info: [debug] Reusing dynamic bootstrap: /Users/kingson/Library/Application Support/appium/bootstrap/bootstrap-cf7bfecca051fdad.js
info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"6.1","iOSSDKVersion":"8.    1","deviceName":"iPhone","platformVersion":null}
info: [debug] fixDevice is on
info: [debug] Final device string is: 'iPhone (8.1 Simulator)'
info: [debug] Not setting device type since we're on a real device
info: [debug] Checking whether we need to set app preferences
info: [debug] Not setting iOS and app preferences since we're on a real device
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] On a real device; cannot clean device state
info: [debug] Not setting locale because we're using a real device
info: [debug] No iOS / app preferences to set
info: [debug] Starting iOS device log capture via deviceconsole
info: [debug] Not pre-launching simulator
info: [debug] Creating iDevice object with udid 6834367d2b8bf681f7bb7f92fd856d0c38d77d84
info: [debug] Couldn't find ideviceinstaller, trying built-in at /usr/local/lib/node_modules/appium/build/libimobiledevice-    macosx/ideviceinstaller
info: [debug] Checking app install status using: /usr/local/lib/node_modules/appium/build/fruitstrap/fruitstrap isInstalled --id     6834367d2b8bf681f7bb7f92fd856d0c38d77d84 --bundle com.telenavsoftware.doudouy
info: [debug] App is installed.
info: [debug] fullReset not requested. No need to install.
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 real device with UDID 6834367d2b8bf681f7bb7f92fd856d0c38d77d84
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 6834367d2b8bf681f7bb7f92fd856d0c38d77d84 com.telenavsoftware.doudouy -e UIASCRIPT     "/Users/kingson/Library/Application Support/appium/bootstrap/bootstrap-cf7bfecca051fdad.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {"global":90000}
info: [debug] [INST STDERR] 2014-10-30 11:20:27.906 instruments[55136:747163] WebKit Threading Violation - initial use of WebKit from     a secondary thread.
info: [debug] [INST STDERR] 2014-10-30 11:20:31.814 instruments[55136:747160] Automation Instrument ran into an exception while     trying to run the script.  UIAScriptAgentSignaledException
info: [debug] [INST] 2014-10-30 03:20:31 +0000 Fail: An error occurred while trying to run the script.
info: [debug] [INST] Instruments Trace Complete (Duration : 1.296846s; 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 real device with UDID 6834367d2b8bf681f7bb7f92fd856d0c38d77d84
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 6834367d2b8bf681f7bb7f92fd856d0c38d77d84 com.telenavsoftware.doudouy -e UIASCRIPT     "/Users/kingson/Library/Application Support/appium/bootstrap/bootstrap-cf7bfecca051fdad.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {"global":90000}
info: [debug] [INST STDERR] 2014-10-30 11:20:38.957 instruments[55143:747340] WebKit Threading Violation - initial use of WebKit from     a secondary thread.
info: [debug] [INST STDERR] 2014-10-30 11:20:41.434 instruments[55143:747340] Automation Instrument ran into an exception while     trying to run the script.  UIAScriptAgentSignaledException
info: [debug] [INST] 2014-10-30 03:20:41 +0000 Fail: An error occurred while trying to run the script.
info: [debug] [INST] Instruments Trace Complete (Duration : 1.310035s; 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 #2
info: [debug] Killall iOS Simulator
info: Launching instruments
info: [debug] Attempting to run app on real device with UDID 6834367d2b8bf681f7bb7f92fd856d0c38d77d84
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 6834367d2b8bf681f7bb7f92fd856d0c38d77d84 com.telenavsoftware.doudouy -e UIASCRIPT     "/Users/kingson/Library/Application Support/appium/bootstrap/bootstrap-cf7bfecca051fdad.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {"global":90000}
info: [debug] [INST STDERR] 2014-10-30 11:20:48.964 instruments[55148:747463] WebKit Threading Violation - initial use of WebKit from     a secondary thread.
info: [debug] [INST STDERR] 2014-10-30 11:20:51.399 instruments[55148:747444] Automation Instrument ran into an exception while     trying to run the script.  UIAScriptAgentSignaledException
info: [debug] [INST] 2014-10-30 03:20:51 +0000 Fail: An error occurred while trying to run the script.
info: [debug] [INST] Instruments Trace Complete (Duration : 1.188144s; 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 real device with UDID 6834367d2b8bf681f7bb7f92fd856d0c38d77d84
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 6834367d2b8bf681f7bb7f92fd856d0c38d77d84 com.telenavsoftware.doudouy -e UIASCRIPT     "/Users/kingson/Library/Application Support/appium/bootstrap/bootstrap-cf7bfecca051fdad.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {"global":90000}
info: [debug] [INST STDERR] 2014-10-30 11:20:58.358 instruments[55153:747597] WebKit Threading Violation - initial use of WebKit from     a secondary thread.
info: [debug] [INST STDERR] 2014-10-30 11:21:01.124 instruments[55153:747598] Automation Instrument ran into an exception while     trying to run the script.  UIAScriptAgentSignaledException
info: [debug] [INST] 2014-10-30 03:21:01 +0000 Fail: An error occurred while trying to run the script.
info: [debug] [INST] Instruments Trace Complete (Duration : 1.331719s; 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] 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] On a real device; cannot clean device state
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.<anonymous> (/usr/local/lib/node_modules/appium/node_modules/appium-instruments/lib/instruments.js:308:12)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at Process.ChildProcess._handle.onexit (child_process.js:797: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}

Do you have the issue?

1 Like

Restarting system works for me. If you can kill the instruments process that might also work.

killall -9 instruments

2 Likes

Hi @pr4bh4sh,
Thank you for replay me, I still have the issue when I restarted system.

Yes sometime it happens even after the restart, I’m not sure what fixed the issue at my end. Did you try killing the process?

Hi @Kingson, I have been struggling with the same issue on appium 1.3.1 on a device with iOS7.1. Restarting the instruments or the host box didnt help either. Would appreciate if anyone has any pointers on the issue.

Since I’ve upgraded to Appium 1.3.1 - to make things work with iOS8 - I have the same problem on two devices: iPhone6 and iPhone 5s, both with iOS 8.1. The strange thing is that it works on iPhone 5.

@preetiagg @RobertC
First, You need to enable “UI Automation” setting in setting–developer.
But I have another issue “Can’t launch App”, run test script after, my app invariably keeps loading status. This issue sounds like is bug of Apple, I have the same the issue when I directly used UIAutomation from command line.
There are two devices appear issue on iPhone 6(iOS8.1) and iPod touch 5(iOS8.0), and it works on iPhone 5C(iOS7.1.2).
The below is my other environment info:
Mac OS X: 10.10
Xcode:6.1

2 Likes

Hi @Kingson,

I have been struggling with the same issue on appium 1.3.4 on a simulator with iOS 8.1. Restarting things didnt help either.

I have noticed that when i try to launch the application without signing on ios simulator it works fine.
When i try to run the app after signing i am facing this issue. I would appreciate if anyone has any pointers on the issue.

Hi,

Even I am facing the same issue. I am using the device ipad with the OS v8.1.2 and the Appium version 1.3.3.

Can anyone help on the same.

I would really appreciate the early help as I am in the middle of my project.

Thanks!

It’s possible some of you are experiencing this issue related to notification AIAlert on iOS8 sim which wasn’t present on iOS7 sims (but is on real devices): https://github.com/appium/appium/issues/4178

I’ve set Backend Retries = 10 so it will try to restart the sim 10 times before failing the test, though it still fails somewhat often.

Hi All,

I tried to launch iOS app on following real devices with Appium version v1.3.4, Mac OS X 10.9.5, Xcode 6.1

  1. iPad 2 with iOS 6.1.3
  2. iPhone 4 with iOS 7.0.4
  3. iPad mini with iOS 8.0.2

I am getting “error: Failed to start an Appium session, err was: Error: Instruments crashed on startup”.

Can someone help me?

I have been struggling with this issue past 3 days. I am trying to open simple “settings” page to test my configuration and everything is working fine. But got struck with this issue (Instruments crashed on startup) and trying to crack this one?

can anyone help us here?

My configuration:
iPhone 4S , IOS 8.0 , MAC OS 10.8.5 (Mountain Lion) , XCode 5.1.1,Appium 1.3.4

In the above conversation , I have seen changing developer settings. How to enable this in iPhone 4S , i didn’t this option in the “Settings” can anyone help me?

Regards,
Kiran Edupuganti

Hi Team,

With latest configuration Appium 1.3.4 , Mac 10.9.4 ,Xcode 6.1.1,IOS 8.1 device , able to install app but appium unable to launch app , throwing Failed to launch process with bundle identifier ‘com.XXXX.j4u.entprod’ with “Instruments ceased on startup”.

used the below code to for app installation and launch. I have enabled developer option also in the iPhone.

public class Test1 {

public static IOSDriver driver;

@Test
public void f() throws MalformedURLException {

  DesiredCapabilities capabilities = new DesiredCapabilities();
  
  capabilities.setCapability("automationName", "Appium");
  capabilities.setCapability("browserName", "");
  capabilities.setCapability("autoLaunch",true);
  capabilities.setCapability("platfromName","iOS");
  capabilities.setCapability("platfromVersion","8.1");
  capabilities.setCapability("deviceName","adurgam’s iPhone");
  capabilities.setCapability("udid","e47ba3300ef7bcbb943db3240b5213813a5d3938");
  capabilities.setCapability("bundleId","com.vons.j4u.entprod");
  capabilities.setCapability("app","/kiran/ReferenceFiles/vons.ipa");
  capabilities.setCapability("showIOSLog",true);
  
  
  driver = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);
 driver.manage().timeouts().implicitlyWait(180,TimeUnit.SECONDS);
 
  driver.quit();

}
}
Please see below mentioned log and suggest me.
2015-02-10 15:07:51:798 - info: Welcome to Appium v1.3.4 (REV c8c79a85fbd6870cd6fc3d66d038a115ebe22efe)
2015-02-10 15:07:51:801 - info: Appium REST http interface listener started on 0.0.0.0:4723
2015-02-10 15:07:51:803 - info: [debug] Non-default server args: {“noReset”:true,“log”:"/Kiran/appium.log",“platformName”:“iOS”,“platformVersion”:“8.1”,“defaultDevice”:true,“showSimulatorLog”:true,“defaultCommandTimeout”:7200}
2015-02-10 15:07:51:803 - warn: Deprecated server args: {"–show-sim-log":“use instead: --show-ios-log”}
2015-02-10 15:07:51:804 - info: Console LogLevel: debug
2015-02-10 15:07:51:804 - info: File LogLevel: debug
2015-02-10 15:07:51:969 - info: --> GET /wd/hub/status {}
2015-02-10 15:07:51:970 - info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.4”,“revision”:“c8c79a85fbd6870cd6fc3d66d038a115ebe22efe”}}}
2015-02-10 15:07:51:974 - info: <-- GET /wd/hub/status 200 5.278 ms - 104 {“status”:0,“value”:{“build”:{“version”:“1.3.4”,“revision”:“c8c79a85fbd6870cd6fc3d66d038a115ebe22efe”}}}
2015-02-10 15:08:02:978 - info: --> GET /wd/hub/status {}
2015-02-10 15:08:02:978 - info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.4”,“revision”:“c8c79a85fbd6870cd6fc3d66d038a115ebe22efe”}}}
2015-02-10 15:08:02:979 - info: <-- GET /wd/hub/status 200 1.554 ms - 104 {“status”:0,“value”:{“build”:{“version”:“1.3.4”,“revision”:“c8c79a85fbd6870cd6fc3d66d038a115ebe22efe”}}}
2015-02-10 15:08:43:079 - info: --> POST /wd/hub/session {“desiredCapabilities”:{“automationName”:“Appium”,“platfromName”:“iOS”,“app”:"/kiran/ReferenceFiles/vons.ipa",“showIOSLog”:true,“platformName”:“iOS”,“deviceName”:“adurgam’s iPhone”,“browserName”:"",“autoLaunch”:true,“bundleId”:“com.vons.j4u.entprod”,“udid”:“e47ba3300ef7bcbb943db3240b5213813a5d3938”,“platfromVersion”:“8.1”}}
2015-02-10 15:08:43:080 - info: Client User-Agent string: Apache-HttpClient/4.3.4 (java 1.5)
2015-02-10 15:08:43:081 - 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. : platfromName, platfromVersion
2015-02-10 15:08:43:083 - info: [debug] Using local .ipa from desired caps: /kiran/ReferenceFiles/xxxxx.ipa
2015-02-10 15:08:43:083 - info: [debug] Copying local zip to tmp dir
2015-02-10 15:08:43:115 - info: [debug] /kiran/ReferenceFiles/vons.ipa copied to /var/folders/qc/jks58bf550d13ltv9vwpy4mr0000gn/T/115110-3674-ekzop6/appium-app.zip
2015-02-10 15:08:43:124 - info: [debug] Unzipping /var/folders/qc/jks58bf550d13ltv9vwpy4mr0000gn/T/115110-3674-ekzop6/appium-app.zip
2015-02-10 15:08:43:125 - info: [debug] Testing zip archive: /var/folders/qc/jks58bf550d13ltv9vwpy4mr0000gn/T/115110-3674-ekzop6/appium-app.zip
2015-02-10 15:08:43:352 - info: [debug] Zip archive tested clean
2015-02-10 15:08:43:854 - info: [debug] Unzip successful
2015-02-10 15:08:43:855 - info: [debug] Using locally extracted app: /var/folders/qc/jks58bf550d13ltv9vwpy4mr0000gn/T/115110-3674-ekzop6/Payload/Vons.app
2015-02-10 15:08:43:855 - info: [debug] Creating new appium session 486211da-c92f-4862-a125-1b0f23cf0214
2015-02-10 15:08:43:858 - info: [debug] Removing any remaining instruments sockets
2015-02-10 15:08:43:859 - info: [debug] Cleaned up instruments socket /tmp/instruments_sock
2015-02-10 15:08:43:859 - info: [debug] Setting Xcode folder
2015-02-10 15:08:43:864 - info: [debug] Setting Xcode version
2015-02-10 15:08:43:918 - info: [debug] Setting iOS SDK Version
2015-02-10 15:08:43:970 - info: [debug] Getting sdk version from xcrun with a timeout
2015-02-10 15:08:43:976 - info: [debug] iOS SDK Version set to 8.1
2015-02-10 15:08:43:977 - info: [debug] Not checking whether simulator is available since we’re on a real device
2015-02-10 15:08:43:977 - info: [debug] Detecting automation tracetemplate
2015-02-10 15:08:43:982 - info: [debug] Not auto-detecting udid, running on sim
2015-02-10 15:08:43:984 - info: [debug] Could not parse plist file (as binary) at /var/folders/qc/jks58bf550d13ltv9vwpy4mr0000gn/T/115110-3674-ekzop6/Payload/Vons.app/en.lproj/Localizable.strings
2015-02-10 15:08:43:984 - info: Will try to parse the plist file as XML
2015-02-10 15:08:43:985 - info: [debug] Could not parse plist file (as XML) at /var/folders/qc/jks58bf550d13ltv9vwpy4mr0000gn/T/115110-3674-ekzop6/Payload/Vons.app/en.lproj/Localizable.strings
2015-02-10 15:08:43:986 - warn: Could not parse app Localizable.strings; assuming it doesn’t exist
2015-02-10 15:08:43:986 - info: [debug] Creating instruments
2015-02-10 15:08:43:986 - 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
2015-02-10 15:08:43:987 - info: [debug] Preparing uiauto bootstrap
2015-02-10 15:08:43:987 - info: [debug] Dynamic bootstrap dir: /Users/admin/Library/Application Support/appium/bootstrap
2015-02-10 15:08:43:987 - info: [debug] Dynamic env: {“nodePath”:"/Applications/Appium.app/Contents/Resources/node/bin/node",“commandProxyClientPath”:"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js",“instrumentsSock”:"/tmp/instruments_sock",“interKeyDelay”:null,“justLoopInfinitely”:false,“autoAcceptAlerts”:false,“sendKeyStrategy”:“grouped”}
2015-02-10 15:08:43:993 - info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!
…
2015-02-10 15:08:43:993 - info: [debug] Dynamic bootstrap path: /Users/admin/Library/Application Support/appium/bootstrap/bootstrap-0943baae6b1d6f5b.js
2015-02-10 15:08:43:996 - info: [debug] Reusing dynamic bootstrap: /Users/admin/Library/Application Support/appium/bootstrap/bootstrap-0943baae6b1d6f5b.js
2015-02-10 15:08:43:997 - info: [debug] Getting device string from opts: {“forceIphone”:false,“forceIpad”:false,“xcodeVersion”:“6.1.1”,“iOSSDKVersion”:“8.1”,“deviceName”:“adurgam’s iPhone”,“platformVersion”:“8.1”}
2015-02-10 15:08:43:998 - info: [debug] fixDevice is on
2015-02-10 15:08:43:998 - info: [debug] Final device string is: ‘adurgam’s iPhone (8.1 Simulator)’
2015-02-10 15:08:43:999 - info: [debug] Not setting device type since we’re on a real device
2015-02-10 15:08:43:999 - info: [debug] Checking whether we need to set app preferences
2015-02-10 15:08:43:999 - info: [debug] Not setting iOS and app preferences since we’re on a real device
2015-02-10 15:08:43:999 - info: [debug] Reset not set, not ending sim or cleaning up app state
2015-02-10 15:08:44:000 - info: [debug] Not setting locale because we’re using a real device
2015-02-10 15:08:44:000 - info: [debug] No iOS / app preferences to set
2015-02-10 15:08:44:000 - info: [debug] Starting iOS device log capture via deviceconsole
2015-02-10 15:08:45:098 - info: [debug] Not pre-launching simulator
2015-02-10 15:08:45:099 - info: [debug] Creating iDevice object with udid e47ba3300ef7bcbb943db3240b5213813a5d3938
2015-02-10 15:08:45:100 - info: [debug] Checking app install status using: /Applications/Appium.app/Contents/Resources/node_modules/appium/build/fruitstrap/fruitstrap isInstalled --id e47ba3300ef7bcbb943db3240b5213813a5d3938 --bundle com.xxxxxx.j4u.entprod
2015-02-10 15:08:45:721 - info: [debug] App is not installed. Will try to install the app.
2015-02-10 15:08:45:721 - info: [debug] Installing ipa found at /kiran/ReferenceFiles/vons.ipa
2015-02-10 15:08:45:721 - info: [debug] Creating iDevice object with udid e47ba3300ef7bcbb943db3240b5213813a5d3938
2015-02-10 15:08:47:279 - info: [debug] Nothing found on device, going ahead and installing.
2015-02-10 15:09:00:899 - info: [debug] Starting command proxy.
2015-02-10 15:09:00:901 - info: [debug] Instruments socket server started at /tmp/instruments_sock
2015-02-10 15:09:00:901 - info: [debug] Starting instruments
2015-02-10 15:09:00:908 - info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
2015-02-10 15:09:00:908 - info: Launching instruments
2015-02-10 15:09:00:909 - info: [debug] Attempting to run app on real device with UDID e47ba3300ef7bcbb943db3240b5213813a5d3938
2015-02-10 15:09:00:910 - 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 e47ba3300ef7bcbb943db3240b5213813a5d3938 com.vons.j4u.entprod -e UIASCRIPT “/Users/admin/Library/Application Support/appium/bootstrap/bootstrap-0943baae6b1d6f5b.js” -e UIARESULTSPATH /tmp/appium-instruments
2015-02-10 15:09:00:910 - info: [debug] And extra without-delay env: {}
2015-02-10 15:09:00:910 - info: [debug] And launch timeouts (in ms): {“global”:90000}
2015-02-10 15:09:01:652 - info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 3.) : Failed to launch process with bundle identifier ‘com.xxxxxx.j4u.entprod’
2015-02-10 15:09:01:668 - info: [debug] [INST STDERR] 2015-02-10 20:39:01.668 instruments[3697:4b1b] WebKit Threading Violation - initial use of WebKit from a secondary thread.
2015-02-10 15:09:01:675 - info: [debug] [INSTSERVER] Instruments exited with code 253
2015-02-10 15:09:01:676 - info: [debug] Killall instruments
2015-02-10 15:09:01:678 - info: [debug] Instruments crashed on startup
2015-02-10 15:09:01:678 - info: [debug] Attempting to retry launching instruments, this is retry #1
2015-02-10 15:09:01:678 - info: [debug] Killall iOS Simulator
2015-02-10 15:09:03:982 - info: --> GET /wd/hub/status {}
2015-02-10 15:09:03:983 - info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.4”,“revision”:“c8c79a85fbd6870cd6fc3d66d038a115ebe22efe”},“isShuttingDown”:false},“sessionId”:“486211da-c92f-4862-a125-1b0f23cf0214”}
2015-02-10 15:09:03:984 - info: <-- GET /wd/hub/status 200 1.379 ms - 178 {“status”:0,“value”:{“build”:{“version”:“1.3.4”,“revision”:“c8c79a85fbd6870cd6fc3d66d038a115ebe22efe”},“isShuttingDown”:false},“sessionId”:“486211da-c92f-4862-a125-1b0f23cf0214”}
2015-02-10 15:09:06:681 - info: Launching instruments
2015-02-10 15:09:06:682 - info: [debug] Attempting to run app on real device with UDID e47ba3300ef7bcbb943db3240b5213813a5d3938
2015-02-10 15:09:06:682 - 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 e47ba3300ef7bcbb943db3240b5213813a5d3938 com.xxxxx.j4u.entprod -e UIASCRIPT “/Users/admin/Library/Application Support/appium/bootstrap/bootstrap-0943baae6b1d6f5b.js” -e UIARESULTSPATH /tmp/appium-instruments
2015-02-10 15:09:06:682 - info: [debug] And extra without-delay env: {}
2015-02-10 15:09:06:683 - info: [debug] And launch timeouts (in ms): {“global”:90000}
2015-02-10 15:09:07:361 - info: [debug] [INST STDERR] 2015-02-10 20:39:07.360 instruments[3700:1307] WebKit Threading Violation - initial use of WebKit from a secondary thread.
2015-02-10 15:09:07:415 - info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 3.) : Failed to launch process with bundle identifier ‘com.xxxx.j4u.entprod’
2015-02-10 15:09:07:426 - info: [debug] [INSTSERVER] Instruments exited with code 253
2015-02-10 15:09:07:427 - info: [debug] Killall instruments
2015-02-10 15:09:07:429 - info: [debug] Instruments crashed on startup
2015-02-10 15:09:07:429 - info: [debug] Attempting to retry launching instruments, this is retry #2
2015-02-10 15:09:07:429 - info: [debug] Killall iOS Simulator
2015-02-10 15:09:12:432 - info: Launching instruments
2015-02-10 15:09:12:433 - info: [debug] Attempting to run app on real device with UDID e47ba3300ef7bcbb943db3240b5213813a5d3938
2015-02-10 15:09:12:433 - 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 e47ba3300ef7bcbb943db3240b5213813a5d3938 com.vons.j4u.entprod -e UIASCRIPT “/Users/admin/Library/Application Support/appium/bootstrap/bootstrap-0943baae6b1d6f5b.js” -e UIARESULTSPATH /tmp/appium-instruments
2015-02-10 15:09:12:433 - info: [debug] And extra without-delay env: {}
2015-02-10 15:09:12:433 - info: [debug] And launch timeouts (in ms): {“global”:90000}
2015-02-10 15:09:13:044 - info: [debug] [INST STDERR] 2015-02-10 20:39:13.043 instruments[3703:5d07] WebKit Threading Violation - initial use of WebKit from a secondary thread.
2015-02-10 15:09:13:149 - info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 3.) : Failed to launch process with bundle identifier ‘com.vxxx.j4u.entprod’
2015-02-10 15:09:13:160 - info: [debug] [INSTSERVER] Instruments exited with code 253
2015-02-10 15:09:13:160 - info: [debug] Killall instruments
2015-02-10 15:09:13:163 - info: [debug] Instruments crashed on startup
2015-02-10 15:09:13:163 - info: [debug] Attempting to retry launching instruments, this is retry #3
2015-02-10 15:09:13:163 - info: [debug] Killall iOS Simulator
2015-02-10 15:09:18:167 - info: Launching instruments
2015-02-10 15:09:18:168 - info: [debug] Attempting to run app on real device with UDID e47ba3300ef7bcbb943db3240b5213813a5d3938
2015-02-10 15:09:18:168 - 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 e47ba3300ef7bcbb943db3240b5213813a5d3938 com.vons.j4u.entprod -e UIASCRIPT “/Users/admin/Library/Application Support/appium/bootstrap/bootstrap-0943baae6b1d6f5b.js” -e UIARESULTSPATH /tmp/appium-instruments
2015-02-10 15:09:18:168 - info: [debug] And extra without-delay env: {}
2015-02-10 15:09:18:168 - info: [debug] And launch timeouts (in ms): {“global”:90000}
2015-02-10 15:09:18:807 - info: [debug] [INST STDERR] 2015-02-10 20:39:18.806 instruments[3706:4963] WebKit Threading Violation - initial use of WebKit from a secondary thread.
2015-02-10 15:09:18:920 - info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 3.) : Failed to launch process with bundle identifier ‘com.xxxx.j4u.entprod’
2015-02-10 15:09:18:931 - info: [debug] [INSTSERVER] Instruments exited with code 253
2015-02-10 15:09:18:931 - info: [debug] Killall instruments
2015-02-10 15:09:18:933 - info: [debug] Instruments crashed on startup
2015-02-10 15:09:18:933 - info: [debug] We exceeded the number of retries allowed for instruments to successfully start; failing launch
2015-02-10 15:09:18:933 - info: [debug] Stopping iOS log capture
2015-02-10 15:09:18:934 - info: [debug] Reset not set, not ending sim or cleaning up app state
2015-02-10 15:09:18:934 - info: [debug] Cleaning up appium session
2015-02-10 15:09:18:934 - error: Failed to start an Appium session, err was: Error: Instruments crashed on startup
2015-02-10 15:09:18:935 - info: [debug] Error: Instruments crashed on startup
at Instruments.onInstrumentsExit (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/lib/instruments.js:387:31)
at null. (/Applications/Appium.app/Contents/Resources/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)
2015-02-10 15:09:18:935 - 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}
2015-02-10 15:09:18:936 - info: <-- POST /wd/hub/session 500 35858.580 ms - 182

Can anyone in this forum , help me in this?

Regards,
Kiran

Try to build app locally on the device in Xcode with developer account. Once you do that, this error should not appear anymore on this specific device…
Issue on GitHub

1 Like

Hi Kirill,

I build my app locally for my device using Xcode. Then I restart my device once and I am able to run my automation. Thanks :smile:

One more query : If app is installed on my device then appium does not uninstall app and reinstall it (I observed this behaviour during Android app automation)
Can you please help me ?

Thanks in advance.

1 Like

Great to hear that worked for you :smile:
Are saying that reset function doesn’t reinstall app?
I am not using reset function to reinstall app, as I know it simply clear app and overwrites new version.
Usually, if I need to reinstall app, I just use fruitstrap between tests or before test suites.

Same problem here. But I receive the ipa already built from the dev team…

info: Launching instruments
info: [debug] Attempting to run app on real device with UDID 39bcf05aabb1bddf783b79d452cca052b32e2f2f
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 39bcf05aabb1bddf783b79d452cca052b32e2f2f com.XXX.joynenter -e UIASCRIPT "/Users/wcs_mac/Library/Application Support/appium/bootstrap/bootstrap-c5bdf70fd65223c0.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {"global":90000}
info: [debug] [INST STDERR] 2015-04-30 17:25:46.349 instruments[53700:4e1f] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 3.) : Failed to launch process with bundle identifier 'com.XXX.joynenter'
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 #3
info: [debug] Killall iOS Simulator
info: Launching instruments
info: [debug] Attempting to run app on real device with UDID 39bcf05aabb1bddf783b79d452cca052b32e2f2f
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 39bcf05aabb1bddf783b79d452cca052b32e2f2f com.XXX.joynenter -e UIASCRIPT "/Users/wcs_mac/Library/Application Support/appium/bootstrap/bootstrap-c5bdf70fd65223c0.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {"global":90000}
info: [debug] [INST STDERR] 2015-04-30 17:25:52.542 instruments[53703:5237] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 3.) : Failed to launch process with bundle identifier 'com.XXX.joynenter'
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] On a real device; cannot clean device state
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/avm/versions/1.3.7/node_modules/appium/node_modules/appium-instruments/lib/instruments.js:389:31)
    at null.<anonymous> (/usr/local/avm/versions/1.3.7/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:810: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 28448.214 ms - 182

Did a quick search of the forum with your error and found this:

Maybe that will help.

Thanks, but its not that. I use same device to test other app with sucess. Probably it has something to do with the way it xcode was configured where it was signed, but I’ll need more info to pass to dev team in order for them to change anything.

I am facing the same issue as “Instruments crashed on startup”

also my simulator screen behaves abnormal … as if someone is clicking on screen***this happens for 7-8 times then simulator is rebooted

Please help me with this issue… I read comments above but didnt get the exact solution please someone guide me