【发布时间】:2025-12-30 02:05:10
【问题描述】:
我正在为我们的一个 iOS 项目设置 CI 环境。到目前为止,我已经让 Jenkins 从命令行构建和打包应用程序。我在 Instruments (Automation) 中编写了一个自动化测试,我想从命令行/终端启动它。我已经按照这里的帖子描述了执行此操作的方法(Start Instruments from the command line 和Can the UI Automation instrument be run from the command line?),所以我知道这是可能的。
不幸的是,当我尝试这个时,我收到了一个警报:
“无法打开文档“AutomatedTests.js”。仪器无法打开“TextWrangler 文本文档”格式的文件。”
这是我正在使用的命令:
/Applications/Xcode4.6.3.app/Contents/Applications/Instruments.app/Contents/MacOS/Instruments \
-t /Applications/Xcode4.6.3.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate -a "/Users/[CI USERNAME]/workspace/[IOS APP FOLDER]/IOS/build/Debug-iphoneos/[IOS APP NAME].app" \
-e UIASCRIPT /Users/[CI USERNAME]/workspace/[IOS APP FOLDER]/IOS/[FOLDER CONTAINING TEST FILE]/AutomatedTests.js
【问题讨论】:
-
这个问题看起来可能是由于您编写测试的程序。它提到了 Text Wrangler,是您编写测试的程序还是刚刚安装在机器上?
-
您很可能需要确保您的文本编辑器保存为纯文本 (UTF-8) 而不是 RTF 或其他一些专有格式
标签: javascript ios xcode