How to reset tools after rejecting Automation Instrument command

(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?

+6
source share
2 answers

Try downloading Xcode 4.4.1 (iOS dev center) and use its 4.4 tools (4445). This version works for all my devices.

FYI, when I use 4.5+ or even 4.6DP4, only iOS6 devices respond normally; others fail with the same message as yours. Try maybe even 4.3.3 if 4.4 does not work.

+1
source

For everyone who has this problem, I will explain what worked for me and how I solved it.

I ran the ps command to see which processes are running. I found that the tools are still working. Then I did killall instruments and killed the instrument. Then I executed the command of my tools, and after that it worked perfectly.

0
source

Source: https://habr.com/ru/post/926225/


All Articles