有人成功在Xcode中设置自动化UIAutomation测试吗?
我正在尝试在我的Xcode项目中设置一个目标,该目标应运行我准备的所有UIAutomation脚本。目前,该目标的唯一构建阶段是这个运行脚本块:
TEMPLATE="/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate"
MY_APP="/Users/Me/Library/Application Support/iPhone Simulator/6.0/Applications/564ED15A-A435-422B-82C4-5AE7DBBC27DD/MyApp.app"
RESULTS="/Users/Me/Projects/MyApp/Tests/UI/Traces/Automation.trace"
SCRIPT="/Users/Me/Projects/MyApp/Tests/UI/SomeTest.js"
instruments -t $TEMPLATE $MY_APP -e UIASCRIPT $SCRIPT -e UIARESULTSPATH $RESULTS
当我构建此目标时,几秒钟后成功,但实际上脚本并没有运行。在构建日志中,我得到了以下错误:
instruments[7222:707] Failed to load Mobile Device Locator plugin
instruments[7222:707] Failed to load Simulator Local Device Locator plugin
instruments[7222:707] Automation Instrument ran into an exception while trying to run the script. UIATargetHasGoneAWOLException
+0000 Fail: An error occurred while trying to run the script.
Instruments Trace Complete (Duration : 1.077379s; Output : /Users/Me/Projects/MyApp/Tests/UI/Traces/Automation.trace)
我很确定我的JavaScript和运行脚本都是正确的,因为如果我在bash中运行完全相同的Instruments命令,它会按预期工作。这可能是Xcode的一个错误吗?
xcrun
运行Instruments吗?也许这可以帮助正确设置其环境?例如:xcrun instruments -t [...]
- Till