Instruments crashed on startup

Getting following error. Running this through Appium App, it was working before, there has been no changes in App

Version used:
IOS 8.4
Appium 1.4.13

Instruments Usage Error : Specified target process is invalid:
instruments, version 7.2.1 (59503)
usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument …]]]

info: [debug] [INSTSERVER] Instruments exited with code 255

error: Could not pre-launch appium: Error: Instruments crashed on startup

Please let me know if anyone has any suggestions on this , Thanks!

Please post full log.

Launching Appium with command: ‘/Applications/Appium.app/Contents/Resources/node/bin/node’ lib/server/main.js --address “127.0.0.1” --command-timeout “7200” --session-override --pre-launch --debug-log-spacing --platform-version “8.4” --platform-name “iOS” --app “Path to App with .ipa" --udid “" --full-reset --default-device

info: [debug] Starting Appium in pre-launch mode

info: Pre-launching app
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: [debug] Using local .ipa from command line: .ipa
info: [debug] Copying local zip to tmp dir

info: [debug] .ipa copied to /var/folders/mg/4lxf1lcn5d392c5l76fj0h2mjwkgnr/T/116214-1178-1u2sp99/appium-app.zip

info: [debug] Unzipping /var/folders/mg/4lxf1lcn5d392c5l76fj0h2mjwkgnr/T/116214-1178-1u2sp99/appium-app.zip

info: [debug] Testing zip archive: /var/folders/mg/4lxf1lcn5d392c5l76fj0h2mjwkgnr/T/116214-1178-1u2sp99/appium-app.zip

info: [debug] Zip archive tested clean

info: [debug] Unzip successful

info: [debug] Using locally extracted app: /var/folders/mg/4lxf1lcn5d392c5l76fj0h2mjwkgnr/T/116214-1178-1u2sp99/Payload/.app

info: [debug] Creating new appium session 86890cf2-3b4f-4877-8049-63197f9cd7f9
info: [debug] Removing any remaining instruments sockets
info: [debug] Cleaned up instruments socket /tmp/instruments_sock
info: [debug] Auto-detecting iOS udid…
info: [debug] Not auto-detecting udid, running on sim
info: [debug] Could not parse plist file (as binary) at /var/folders/mg/4lxf1lcn5d392c5l76fj0h2mjwkgnr/T/116214-1178-1u2sp99/Payload/.app/en.lproj/Localizable.strings
info: Will try to parse the plist file as XML
info: [debug] Could not parse plist file (as XML) at /var/folders/mg/4lxf1lcn5d392c5l76fj0h2mjwkgnr/T/116214-1178-1u2sp99/Payload/.app/en.lproj/Localizable.strings
warn: Could not parse app Localizable.strings assuming it doesn’t exist
info: [debug] Getting bundle ID from app

info: [debug] Parsed app Info.plist (as binary)
info: [debug] Creating instruments
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: //Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {“nodePath”:"/Applications/Appium.app/Contents/Resources/node/bin/node",“commandProxyClientPath”:"/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-uiauto/bin/command-proxy-client.js",“instrumentsSock”:"/tmp/instruments_sock",“interKeyDelay”:null,“justLoopInfinitely”:false,“autoAcceptAlerts”:false,“autoDismissAlerts”:false,“sendKeyStrategy”:“grouped”}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!

info: [debug] Dynamic bootstrap path: //Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js

info: [debug] Reusing dynamic bootstrap: //Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js
info: [debug] Attempting iOS device log capture via libimobiledevice idevicesyslog

info: [debug] Creating iDevice object with did

info: [debug] App is not installed. Will try to install the app.

info: [debug] Installing ipa found at /.ipa

info: [debug] Nothing found on device, going ahead and installing.

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
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 -e UIASCRIPT “/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.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] Instruments Usage Error : Specified target process is invalid:

info: [debug] [INST STDERR] instruments, version 7.2.1 (59503)
usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument …]]]

info: [debug] [INSTSERVER] Instruments exited with code 255
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

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 -e UIASCRIPT “//Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.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] 2016-03-14 13:47:03.290 instruments[1199:56208] WebKit Threading Violation - initial use of WebKit from a secondary thread.

info: [debug] [INST STDERR] Instruments Usage Error : Specified target process is invalid:

info: [debug] [INST STDERR] instruments, version 7.2.1 (59503)
usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument …]]]

info: [debug] [INSTSERVER] Instruments exited with code 255
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] [INSTSERVER] Instruments exited with code 255
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] Killing any other simulator daemons
info: [debug] Killall iOS Simulator

info: [debug] fullReset requested. Will try to uninstall the app.

info: [debug] Cleaning up appium session

error: Could not remove from device

I think you’ve uncovered a real bug here. Looks like you are passing an empty string instead of the UDID/UUID of the device and that Appium is not catching it and trying to run an instruments command without the UDID/UUID.

Try adding the real UDID/UUID instead of the blank string.

Sorry, that was an attempt to remove company specific info.
It does pass UDID after ‘-w’ flag
so -w -e UIASCRIPT “Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js”

Unless you are suggesting to try something else.

-w UDID BundleID -e UIASCRIPT …

Can you try running that command from the terminal? This one, but with the UDID added:

Also, can you take a look at the Instruments log file in /tmp/appium-instruments and see what that says?

One more thing for you to try. Can you install your app on the device, attach it to the Mac, open a terminal and do:

ideviceinstaller -U <UUID> -l

Just to check what the bundleId is on the app.

  1. Running from command line : I got same error :

Instruments Usage Error : Specified target process is invalid: Bundle ID

2 did not get any logs in /tmp/appium-instruments

3 running ideviceinstaller -U UUID -l
I did get the correct Bundle ID in the list of Apps installed.

Note : This whole setup was working earlier,
Although I did run this command 2 days back brew install --HEAD ideviceinstaller
Not sure if updating this has something to do with it. I run Appium.App with version 1.4.13

Very strange. Anything unusual about the bundleId? Strange characters, or anything like that?

Not sure about the brew command. I’m not seeing any ideviceinstaller log entries–are you?

Kill Instruments, and try launching your app through Xcode->Instruments->Automation.

Then try running your Automation Code.

Do you run on simulator?
If so, try enabling IOS Settings - Advanced ‘Use Native Instruments Library’ in Appium Settings.

Thanks for all the responses
I did these 3 things and now it works.

  1. Reinstalled ideviceInstaller,
  2. added the setting ‘Use Native Instruments Library’
  3. Reinstalled the app
1 Like