【问题标题】:RunUnitTests error after Xcode 5 updateXcode 5 更新后的 RunUnitTests 错误
【发布时间】:2013-09-27 23:35:32
【问题描述】:

我所做的只是将项目更新到 Xcode 5。现在当我尝试运行测试时,我收到了这个错误

if [ "${TEST_AFTER_BUILD}" = "YES" ]; then
    Error ${LINENO} "RunUnitTests is obsolete. To run unit tests for your target, use the Test scheme action in the Xcode IDE and the test action in xcodebuild."
    Note ${LINENO} "You can remove the Run Script build phase that invokes RunUnitTests from your unit test bundle target."
    # Exit with EX_UNAVAILABLE to indicate that this subsystem is unavailable.
    exit 69
fi

Error ${LINENO} "RunUnitTests is obsolete. To run unit tests for your target, use the Test scheme action in the Xcode IDE and the test action in xcodebuild." 以红色突出显示。我用谷歌搜索了这个问题,但找不到任何答案。可能是什么问题,我该如何解决?

【问题讨论】:

    标签: xcode unit-testing xcode5


    【解决方案1】:

    您很可能将构建设置 Test After Build 设置为 YES。 Xcode 5 不支持 Test After Build 构建设置。将构建后的测试设置为否,错误应该会消失。

    【讨论】:

    • 非常感谢它解决了我的问题!
    • 此选项不再出现在 Xcode 5 的 UI 中。它现在是一个名为“TEST_AFTER_BUILD”的用户定义设置。
    【解决方案2】:

    使用这个命令。

    xcodebuild test -scheme <YOUR SCHEME NAME HERE> -destination OS=6.1,name=iPhone

    我也用谷歌搜索并找到了这个网站。 http://petosoft.wordpress.com/2013/06/25/running-unit-tests-using-jenkins-and-xcodebuild-on-xcode-5-0/

    【讨论】:

    • 请将所有内联代码块包含在 ` 中,以便将它们格式化为代码。对于多行代码,或者将它们缩进 4 个空格(或)使用按钮栏中的 {} 按钮。其他事情,而不是发布链接,请将其基本内容也发布到答案中。这将确保即使链接变为非活动状态,您的答案也不会失去价值。
    【解决方案3】:

    TEST_AFTER_BUILD 选项成为 Xcode 5 中的用户定义设置。删除它就可以了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-24
      • 2020-07-14
      • 2013-01-13
      • 2015-01-05
      • 2015-12-30
      相关资源
      最近更新 更多