【发布时间】:2013-03-02 20:56:19
【问题描述】:
我关注这个网站是为了开始使用 UI 自动化。 http://blog.manbolo.com/2012/04/08/ios-automated-tests-with-uiautomation#1.2
我正在尝试从命令行启动 Instruments。不幸的是,我收到一个错误:
2013-03-14 14:06:36.376 instruments[17854:1207] Connection to the remote device lost while launching target. Aborting...
2013-03-14 14:06:36.378 instruments[17854:1207] Recording cancelled : At least one target failed to launch; aborting run
Instruments Trace Error : Failed to start trace.
这是我使用的命令:
instruments -w {deviceId} -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate {appname} -e UIASCRIPT /Path/to/Script.js
目前我使用的是 Xcode 4.6。
【问题讨论】:
-
设备上是否安装了应用程序? Instruments 不会自动安装在设备上(至少目前不会)。你有
{appname}作为参数。您不能只指定名称。您必须指定 Xcode 构建的应用程序包的完整路径。 Instruments 使用它来找出包标识符,以便知道要在设备上启动什么应用程序。 -
哦,我的演示应用程序中的这个脚本可能会有所帮助:github.com/jonathanpenn/ScheduleDemo/blob/master/test_run.sh
标签: command-line instruments ios-ui-automation