自动化仪器拒绝命令后如何重置仪器

jha*_*ott 6 instruments ios-ui-automation

(Xcode 4.5)

从命令行运行仪器时,它第一次工作但直到我重新启动后它才会再次运行.

Instruments的详细输出包括:

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.
Run Code Online (Sandbox Code Playgroud)

我用来运行仪器的命令行是这样的(为清晰起见,分成多行):

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
Run Code Online (Sandbox Code Playgroud)

我已经尝试比较在第一次(成功)运行之前和之后运行的进程ps以及在使用之前和之后打开了哪些文件/管道lsof,但我找不到任何建议为什么它不会运行多次.

该错误似乎表明仪器内的自动化仪器拒绝该purpose:Trace命令,所以我尝试删除输出跟踪目录(如果自动递增的文件名导致问题),我尝试使用不同的模板运行仪器在运行之间查看是否可以清除阻止它的任何内容,但是每次重新启动时我无法让它工作多次.

我怀疑自动化仪器或仪器使用的共享库中存在一些无效状态.我需要一种方法从命令行重置此状态,以便我可以在CI服务器上可靠地运行自动化测试.

有没有办法比较之前/之后加载的共享库和卸载它们?有没有人对可能存在的内容以及如何重置它有任何其他想法?

Eri*_*hen 1

尝试下载 Xcode 4.4.1(iOS 开发中心)并使用其 Instruments 4.4 (4445)。此版本适用于我的所有设备。

仅供参考,当我使用 4.5+,甚至 4.6DP4 时,只有 iOS6 设备可以正常响应;其他人会失败并显示与您相同的消息。尝试一下,如果 4.4 效果不好,甚至可以使用 4.3.3。