【发布时间】:2012-09-17 05:22:27
【问题描述】:
(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.
我用来运行仪器的命令行是这样的(为了清楚起见,分成多行):
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
我尝试比较使用ps 第一次(成功)运行之前和之后正在运行的进程以及在使用lsof 之前和之后打开了哪些文件/管道,但我找不到任何说明原因它不会运行超过一次。
错误似乎表明仪器中的自动化仪器拒绝purpose:Trace 命令,因此我尝试删除输出跟踪目录(以防自动递增的文件名导致问题),我尝试过在两次运行之间使用不同的模板运行仪器,看看这是否能清除阻碍它的东西,但每次重新启动时我不能让它工作超过一次。
我怀疑自动化仪器或仪器使用的共享库中有一些无效状态。我需要一种从命令行重置此状态的方法,以便我可以在 CI 服务器上可靠地运行自动化测试。
有没有办法比较之前/之后加载哪些共享库并卸载它们? 有没有人对可能持续存在的内容以及如何重置它有任何其他想法?
【问题讨论】:
-
3 个月后我仍然看到这个。我什至尝试了 4.6p4。你有什么新的见解或技巧吗?这让我很沮丧,因为它可以在所有 iOS6 设备上完美运行,除了一台装有 iOS5(故意)的 iPod touch。相关:lists.apple.com/archives/xcode-users/2012/Sep/msg00187.html
标签: instruments ios-ui-automation