有没有人成功在 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 中运行完全相同的仪器命令,它会按预期工作。这可能是 Xcode 中的错误吗?