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"


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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值