Hello,
It seems as if we’re running into an intermittent issue where our execution fails within Instruments. Just as a heads up, here’s what our execution environment looks like:
Appium 1.4.16
OS: OSX
Device: iPhone 6S+ (iOS 9.1)
See below for appium logs.
e[36minfoe[39m: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d)
e[36minfoe[39m: Appium REST http interface listener started on 0.0.0.0:4723
e[36minfoe[39m: Console LogLevel: debug
e[36minfoe[39m: e[37m-->e[39m e[37mPOSTe[39m e[37m/wd/hub/sessione[39m e[90m{"desiredCapabilities":{"udid":"6f61dc637c95b6dad64ebce47fa956afb255bd57","platformName":"iOS","platformVersion":null,"deviceName":"iPad","sendKeyStrategy":"grouped","autoAcceptAlerts":false,"waitForAppScript":true,"app":"bundleId","newCommandTimeout":180}}e[39m
e[36minfoe[39m: Client User-Agent string: appium/ruby_lib/8.0.2
e[36minfoe[39m: [debug] App is an iOS bundle, will attempt to run as pre-existing
e[36minfoe[39m: [debug] Creating new appium session 3eb06a61-ce59-4f03-9813-4e2d55af4378
e[36minfoe[39m: [debug] Removing any remaining instruments sockets
e[36minfoe[39m: [debug] Cleaned up instruments socket /tmp/instruments_sock
e[36minfoe[39m: [debug] Auto-detecting iOS udid...
e[36minfoe[39m: [debug] Not auto-detecting udid, running on sim
e[36minfoe[39m: [debug] Could not parse plist file (as binary) at /usr/local/avm/versions/1.4.16/node_modules/appium/bundleId/en.lproj/Localizable.strings
e[36minfoe[39m: Will try to parse the plist file as XML
e[36minfoe[39m: [debug] Could not parse plist file (as XML) at /usr/local/avm/versions/1.4.16/node_modules/appium/bundleId/en.lproj/Localizable.strings
e[33mwarne[39m: Could not parse app Localizable.strings assuming it doesn't exist
e[36minfoe[39m: [debug] Creating instruments
e[36minfoe[39m: [debug] Preparing uiauto bootstrap
e[36minfoe[39m: [debug] Dynamic bootstrap dir: /Users/teamcity/Library/Application Support/appium/bootstrap
e[36minfoe[39m: [debug] Dynamic env: {"nodePath":"/usr/local/Cellar/nvm/0.29.0/versions/node/v0.12.7/bin/node","commandProxyClientPath":"/usr/local/avm/versions/1.4.16/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js","instrumentsSock":"/tmp/instruments_sock","interKeyDelay":null,"justLoopInfinitely":false,"autoAcceptAlerts":false,"autoDismissAlerts":false,"sendKeyStrategy":"grouped"}
e[36minfoe[39m: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!
...
e[36minfoe[39m: [debug] Dynamic bootstrap path: /Users/teamcity/Library/Application Support/appium/bootstrap/bootstrap-d66effb3cda9df33.js
e[36minfoe[39m: [debug] Reusing dynamic bootstrap: /Users/teamcity/Library/Application Support/appium/bootstrap/bootstrap-d66effb3cda9df33.js
e[36minfoe[39m: [debug] Attempting iOS device log capture via libimobiledevice idevicesyslog
e[36minfoe[39m: [debug] Creating iDevice object with udid 6f61dc637c95b6dad64ebce47fa956afb255bd57
e[36minfoe[39m: [debug] App is installed.
e[36minfoe[39m: [debug] fullReset not requested. No need to install.
e[36minfoe[39m: [debug] Starting command proxy.
e[36minfoe[39m: [debug] Instruments socket server started at /tmp/instruments_sock
e[36minfoe[39m: [debug] Starting instruments
e[36minfoe[39m: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
e[36minfoe[39m: Launching instruments
e[36minfoe[39m: [debug] Attempting to run app on real device with UDID 6f61dc637c95b6dad64ebce47fa956afb255bd57
e[36minfoe[39m: On xcode 7.0, instruments-without-delay does not work, skippinginstruments-without-delay
e[36minfoe[39m: [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 6f61dc637c95b6dad64ebce47fa956afb255bd57 bundleId -e UIASCRIPT "/Users/teamcity/Library/Application Support/appium/bootstrap/bootstrap-d66effb3cda9df33.js" -e UIARESULTSPATH /tmp/appium-instruments
e[36minfoe[39m: [debug] And launch timeouts (in ms): {"global":90000}
e[36minfoe[39m: [debug] e[33m[INST STDERR] 2016-04-26 22:10:41.747 instruments[36213:4394407] WebKit Threading Violation - initial use of WebKit from a secondary thread.e[39m
e[36minfoe[39m: [debug] e[33m[INST STDERR] Instruments Usage Error: Specified target process is invalid: bundleId
instruments, version 7.3 (60133)
usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument ...]]]e[39m
e[36minfoe[39m: [debug] e[90m[INSTSERVER] Instruments exited with code 255e[39m
e[36minfoe[39m: [debug] Killall instruments
e[36minfoe[39m: [debug] Instruments crashed on startup
e[36minfoe[39m: [debug] Attempting to retry launching instruments, this is retry #1
e[36minfoe[39m: [debug] Killall Simulator
e[36minfoe[39m: Launching instruments
e[36minfoe[39m: [debug] Attempting to run app on real device with UDID 6f61dc637c95b6dad64ebce47fa956afb255bd57
e[36minfoe[39m: On xcode 7.0, instruments-without-delay does not work, skippinginstruments-without-delay
e[36minfoe[39m: [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 6f61dc637c95b6dad64ebce47fa956afb255bd57 bundleId -e UIASCRIPT "/Users/teamcity/Library/Application Support/appium/bootstrap/bootstrap-d66effb3cda9df33.js" -e UIARESULTSPATH /tmp/appium-instruments
e[36minfoe[39m: [debug] And launch timeouts (in ms): {"global":90000}
e[36minfoe[39m: [debug] e[33m[INST STDERR] 2016-04-26 22:10:47.692 instruments[36242:4394622] WebKit Threading Violation - initial use of WebKit from a secondary thread.e[39m
e[36minfoe[39m: [debug] e[33m[INST STDERR] Instruments Usage Error: Specified target process is invalid: bundleId
instruments, version 7.3 (60133)
usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument ...]]]e[39m
e[36minfoe[39m: [debug] e[90m[INSTSERVER] Instruments exited with code 255e[39m
e[36minfoe[39m: [debug] Killall instruments
e[36minfoe[39m: [debug] Instruments crashed on startup
e[36minfoe[39m: [debug] Attempting to retry launching instruments, this is retry #2
e[36minfoe[39m: [debug] Killall Simulator
e[36minfoe[39m: Launching instruments
e[36minfoe[39m: [debug] Attempting to run app on real device with UDID 6f61dc637c95b6dad64ebce47fa956afb255bd57
e[36minfoe[39m: On xcode 7.0, instruments-without-delay does not work, skippinginstruments-without-delay
e[36minfoe[39m: [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 6f61dc637c95b6dad64ebce47fa956afb255bd57 bundleId -e UIASCRIPT "/Users/teamcity/Library/Application Support/appium/bootstrap/bootstrap-d66effb3cda9df33.js" -e UIARESULTSPATH /tmp/appium-instruments
e[36minfoe[39m: [debug] And launch timeouts (in ms): {"global":90000}
e[36minfoe[39m: [debug] e[33m[INST STDERR] 2016-04-26 22:10:53.686 instruments[36275:4394807] WebKit Threading Violation - initial use of WebKit from a secondary thread.e[39m
e[36minfoe[39m: [debug] e[33m[INST STDERR] Instruments Usage Error: Specified target process is invalid: bundleId
instruments, version 7.3 (60133)
usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument ...]]]e[39m
e[36minfoe[39m: [debug] e[90m[INSTSERVER] Instruments exited with code 255e[39m
e[36minfoe[39m: [debug] Killall instruments
e[36minfoe[39m: [debug] Instruments crashed on startup
e[36minfoe[39m: [debug] Attempting to retry launching instruments, this is retry #3
e[36minfoe[39m: [debug] Killall Simulator
e[36minfoe[39m: Launching instruments
e[36minfoe[39m: [debug] Attempting to run app on real device with UDID 6f61dc637c95b6dad64ebce47fa956afb255bd57
e[36minfoe[39m: On xcode 7.0, instruments-without-delay does not work, skippinginstruments-without-delay
e[36minfoe[39m: [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 6f61dc637c95b6dad64ebce47fa956afb255bd57 bundleId -e UIASCRIPT "/Users/teamcity/Library/Application Support/appium/bootstrap/bootstrap-d66effb3cda9df33.js" -e UIARESULTSPATH /tmp/appium-instruments
e[36minfoe[39m: [debug] And launch timeouts (in ms): {"global":90000}
e[36minfoe[39m: [debug] e[33m[INST STDERR] 2016-04-26 22:10:59.589 instruments[36284:4394900] WebKit Threading Violation - initial use of WebKit from a secondary thread.e[39m
e[36minfoe[39m: [debug] e[33m[INST STDERR] Instruments Usage Error: Specified target process is invalid: bundleId
instruments, version 7.3 (60133)
usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument ...]]]e[39m
e[36minfoe[39m: [debug] e[90m[INSTSERVER] Instruments exited with code 255e[39m
e[36minfoe[39m: [debug] Killall instruments
e[36minfoe[39m: [debug] Instruments crashed on startup
e[36minfoe[39m: [debug] We exceeded the number of retries allowed for instruments to successfully start; failing launch
e[36minfoe[39m: [debug] Stopping iOS log capture
e[36minfoe[39m: [debug] Running ios sim reset flow
e[36minfoe[39m: [debug] Killing the simulator process
e[36minfoe[39m: [debug] Killing any other simulator daemons
e[36minfoe[39m: [debug] Killall Simulator
e[36minfoe[39m: [debug] On a real device; cannot clean device state
e[36minfoe[39m: [debug] Cleaning up appium session
e[36minfoe[39m: [debug] Error: Instruments crashed on startup
at [object Object].Instruments.onInstrumentsExit (/usr/local/avm/versions/1.4.16/node_modules/appium/node_modules/appium-instruments/lib/instruments.js:448:31)
at [object Object].<anonymous> (/usr/local/avm/versions/1.4.16/node_modules/appium/node_modules/appium-instruments/lib/instruments.js:355:12)
at ChildProcess.emit (events.js:110:17)
at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
e[36minfoe[39m: [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}
e[36minfoe[39m: e[37m<-- POST /wd/hub/session e[39me[31m500e[39me[90m 25353.576 ms - 182e[39m e[90me[39m
When we encounter this issue, it will be consistent for every execution but can be worked around if the physical device is restarted. Tests will then successfully run until (from what we’ve observed) the latter half of the day when the problem arises again.
If any further information is needed, let me know.
Cheers