(Xcode 4.5)
When starting tools from the command line, it works for the first time, but then it will not start again until I reboot.
A detailed output of the tools includes the following:
Instruments : Loading template 'file://localhost/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate' Instruments : Setting Instrument Trace Command : Instrument Command (purpose:Idle; output destination:file://localhost/Users/xxxxx/instrumentscli0.trace) Instruments : Trace Command Recognized Instruments : Instrument 'Automation - MyProject' rejected command 'Instrument Command (purpose:Trace; output destination:file://localhost/Users/xxxxx/instrumentscli0.trace)' for target 'Executable (name:MyProject; arguments:)' Instruments : Instruments Rejected Command Instruments Trace Error : Failed to start trace.
The command line that I use to run the tools is (for clarity, split into several lines):
instruments -v -w <DeviceID> -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate /Users/xxxxx/dev/MyProject/build/Debug-iphoneos/MyProject.app -e UIASCRIPT /Users/xxxxx/dev/MyProject/UIAutoTests/some_test.js
I tried to compare which processes were performed before and after the first (successful) start using ps and which files / pipes were opened before and after using lsof , but I can not find anything to suggest why it will not start more than once.
It seems that the error indicates that the automation tool inside the tools rejects the purpose:Trace command, so I tried to delete the output trace directory (in case the auto-incrementing file name caused the problem), I tried running tools with a different pattern between runs to see whether it clears everything that blocks it, but I cannot get it to work more than once per reboot.
My suspicion is that there is some invalid state in the automation tool or in the shared library used by the tools. I need a way to reset this state from the command line so that I can reliably perform automatic checks on the CI server.
Is there a way to compare which shared libraries are loaded before / after and unload them? Does anyone have any other ideas on what might persist and how to reset this?
source share