ios - Xcode命令行测试执行问题

标签 ios xcode unit-testing xcodebuild xctool

我处于一种奇怪的情况,我可以让 xctool 运行我的测试,但我无法找出等效的命令行来获取 xcodebuild 和/或 faSTLane scan 运行我的测试。 我有一个只有 iPad 的应用程序,只有一个方案和两个目标(otto 和 ottoTests)

使用 XCTool 命令行

xctool -scheme otto \
       -sdk iphonesimulator \
        CODE_SIGN_IDENTITY=""\
        CODE_SIGNING_REQUIRED=NO \
       -reporter pretty\
       -reporter junit:./test-reports/otto.xml\
        build test

Xcodebuild - 失败

xcodebuild -sdk iphonesimulator \
           -scheme otto \
      test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO

我得到这个错误

A build only device cannot be used to run this target

enter image description here

所以我在这里有点不知所措 xcodebuild 和正在运行的任何 xctool 之间究竟有什么不同。

最佳答案

AFAICS,您在 xcodebuild 命令中缺少 -destination 参数。引用这个tutorial示例代码。

关于ios - Xcode命令行测试执行问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34267281/

相关文章:

iphone - Cocos2D 场景重新分配

ios - UIdocumentInteractionController 无法在 swift 4 中显示 PDF 文件

Swift 4 LaunchedProcess 启动路径不可访问

objective-c - #include <new> 未找到,但仅当从特定 header 引用该文件时?

ios - 选择 iOS 测试框架

angular - ag-Grid:如何从单元测试访问 gridApi?

delphi - Free Pascal 和 Delphi 的单源单元测试

ios - 检测在 NSString 中占用多个索引点的字符的方法?

ios - 如何在 Swift 上单击按钮时打开 pdf 链接?

ios - 缩放后为不同的标签设置相同的字体大小