【问题标题】:XCode getting "target specifies product type 'com.apple.product-type.bundle.unit-test', but there's no such product type for the 'iphoneos' platform"XCode得到“目标指定产品类型'com.apple.product-type.bundle.unit-test',但'iphoneos'平台没有这样的产品类型”
【发布时间】:2014-07-28 05:35:28
【问题描述】:

在 XCode 中运行我的项目时,我的测试给出了这个错误:

target specifies product type 'com.apple.product-type.bundle.unit-test', but there's no such product type for the 'iphoneos' platform

它发生在几次 XCode 更新之后。有谁知道如何解决这个问题?

【问题讨论】:

    标签: ios objective-c xcode unit-testing xcode6


    【解决方案1】:

    Xcode 6 似乎将 ocunit 测试包的产品标识符从 com.apple.product-type.bundle 更改为 com.apple.product-type.bundle.ocunit-test

    编辑$(ProjectName).xcodeproj/project.pbxproj 并将com.apple.product-type.bundle.ocunit-test 的任何实例替换为com.apple.product-type.bundle。现在,每当您使用 Xcode 6 打开项目,然后想在 Xcode 5 中打开它时,您都需要这样做。

    【讨论】:

    • 这需要获得的不仅仅是赞成票。原发帖者需要勾选这个作为答案。
    • @AlexPretzlav 如何编辑项目名称和 ocunit-test?我找不到这些实例,但我得到了完全相同的错误。
    • @TheveshTheva 在您的.xcodeproj 文件中编辑名为project.pbxproj 的文件(它可能看起来像一个文件,但实际上是一个文件夹,请使用终端)
    • 真的它需要更多的赞成票,不幸的是我只能给一个,但它值得 100 老兄,我在过去的两个小时里一直在尝试,但没有找到正确的解决方案。但是您的回答很有帮助。
    • 我有同样的错误,但我该如何改变它。我是所有这些东西的新手,任何人都可以给我一步一步的指导。谢谢
    【解决方案2】:

    对我有用的是:

    1. 删除 launchScreen.storyboard(移至回收站)。
    2. 创建一个新的launchScreen.storyboard..From File -> new File ->iOS User Interface -> LaunchScreen(我命名为相同的AND!检查标记了底部的所有目标)
    3. 将部署目标从我创建项目的 9.1 更改为 8.3(这是为项目和目标完成的)
    4. 到目前为止,我仍然遇到同样的错误
    5. 我刚刚从 Xcode 的这一部分删除了 ProjectNameUITest picture here

    【讨论】:

      猜你喜欢
      • 2014-11-09
      • 1970-01-01
      • 2014-12-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多