可以在UI自动化仪表从命令行运行? [英] Can the UI Automation instrument be run from the command line?

查看:136
本文介绍了可以在UI自动化仪表从命令行运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法通过终端来打开 UIAutomation 乐器?

,才有可能写一个的AppleScript 打开苹果公司 UIAutomation 工具和加载应用程序进行测试?

能否请你告诉我在那里通过脚本或通过命令行,我们可以打开任何方式 UIAutomation 并选择应用程序进行测试,以及选择测试脚本?


解决方案

 仪器-t /Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/ \\
插件/ AutomationInstrument.bundle /内容/资源/ Automation.tracetemplate \\
< full_path_to_application> -e UIASCRIPT< path_to_script.js> \\
-e UIARESULTSPATH< output_results_path>

对于x code> = 4.5

 仪器-t
/Applications/X$c$c.app/Contents/Applications/Instruments.app/Contents/PlugIns/ \\
AutomationInstrument.bundle /内容/资源/ Automation.tracetemplate \\
< full_path_to_application> -e UIASCRIPT< path_to_script.js> \\
-e UIARESULTSPATH< output_results_path>

对于x code> = 6.1

 仪器-w<设备ID> -t \\
/Applications/X$c$c.app/Contents/Applications/Instruments.app/Contents/PlugIns/ \\
AutomationInstrument.xrplugin /内容/资源/ Automation.tracetemplate \\
< full_path_to_application> -e UIASCRIPT< path_to_script.js> \\
-e UIARESULTSPATH< output_results_path>

有一些重要的事情,但请注意:


  1. 除非你想你的设备上运行脚本不需要-w参数。如果你想在模拟器上运行脚本,只需省略命令该参数。

  2. full_path_to_application是的路径是由你的模拟器创建您的.app文件。对我来说,道路是


      

    /用户/ fwasim /库/应用程序支持/ iPhone模拟器/ 5.0 /应用/ AA6BA2E1-D505-4864-BECC-29ADEE28194D / name_of_application.app <​​/ P>

    这个路径可能是其他任何人根据什么的iOS版本,你在你的模拟器运行的不同。还记得把在双引号这条路。


  3. 该path_to_script.js应该是完整路径用JavaScript编写自动化脚本保存。还记得把在双引号这条路。


  4. 最后结果输出路径是要保存输出结果的路径。还记得把在双引号这条路。


这些都是我一直缺少的点,从而渐渐上面提到的一些错误。

Is there a way to open the UIAutomation instrument through the terminal?

Will it be possible to write an AppleScript to open Apple's UIAutomation tool and load the application to be tested?

Can you please tell me is there any way through scripting or through the command line we can open UIAutomation and select the app to be tested, as well as select the test script?

解决方案

instruments -t /Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/\
PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate \
<full_path_to_application> -e UIASCRIPT <path_to_script.js> \
-e UIARESULTSPATH <output_results_path>

for xcode >= 4.5

instruments -t
/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/\
AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate \
<full_path_to_application> -e UIASCRIPT <path_to_script.js> \
-e UIARESULTSPATH <output_results_path>

for xcode >= 6.1

instruments -w <device ID> -t \
/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/\
AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate \
<full_path_to_application> -e UIASCRIPT <path_to_script.js> \
-e UIARESULTSPATH <output_results_path>

There a few important things to note though:

  1. the -w parameter is not required unless you want to run the scripts on your device. If you want to run your scripts on the simulator, simply omit this parameter from the command.
  2. full_path_to_application is the path to your .app file that is created by your simulator. For me, the path was

    /Users/fwasim/Library/Application Support/iPhone Simulator/5.0/Applications/AA6BA2E1-D505-4864-BECC-29ADEE28194D/name_of_application.app

    this path might be different for anyone else depending on what iOS version are you running on your simulator. Also remember to put this path in double quotation marks.

  3. The path_to_script.js should be the FULL PATH to where your automation script written in javascript is saved. Also remember to put this path in double quotation marks.

  4. Lastly output results path is the path where you want to save the output results. Also remember to put this path in double quotation marks.

These were the points I had been missing on and thus was getting some of the errors mentioned above.

这篇关于可以在UI自动化仪表从命令行运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆