zoukankan      html  css  js  c++  java
  • Instruments-Automation: 通过命令行执行测试用例

        为了实现该脚本的自己主动定时执行。我们需要开始在命令行和脚本,详细代码如下所示的:

    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>


    1.  -t 后面的參数为 Automation.tracetemplate 的路径。每一个版本号的位置都有所不同,在命令行下使用 instruments -s 命令进行查询。


    2.  full_path_to_application 是你的的被測应用的完整文件夹,须要在前后加上双引號。
    3.  -e UIASCRIPT  指定运行的 js 脚本存放的位置,须要在前后加上双引號。
    4.  -e UIARESULTPATH  指定输出结果存放的路径,须要在前后加上双引號。

    5. 假设须要在真机执行。在-t 參数前加上  -w UDID, 当中UDID为被连接手机的设备标识(可通过iTools查看)。


    举例在我本地模拟器上的脚本例如以下:

    instruments -t 
    /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate 
    "/Users/wangxinxin/Library/Developer/Xcode/DerivedData/TestAutomation-ahmqgmqipyidexemazbprqxqkrya/Build/Products/Debug-iphonesimulator/TestAutomation.app" 
    -e UIASCRIPT "/Users/wangxinxin/Documents/TestAutomation/test.js" 
    -e UIARESULTSPATH "/Users/wangxinxin/Documents/TestAutomation"


    版权声明:本文博客原创文章,博客,未经同意,不得转载。

  • 相关阅读:
    Unity3D Editor模式下批量修改prefab
    3D touch在Unity3D中的使用
    Unity中的协程是什么?
    Unity3D脚本调用Objective C代码实现游戏内购买
    WindowsPhone8拍照功能实现简介
    WindowsPhone App如何扩展能够使用的内存
    SVN 提交代码时提示文件已经存在解决办法
    iOS检查App新版本并更新新版本
    iOS存储数据字典到沙盒
    统计整个Xcode工程代码行数
  • 原文地址:https://www.cnblogs.com/zfyouxi/p/4749768.html
Copyright © 2011-2022 走看看