XCode得到"目标指定产品类型'com.apple.product-type.bundle.unit-test',但'iphoneos'平台没有这样的产品类型"

Fir*_*ule 31 xcode unit-testing objective-c ios xcode6

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

target specifies product type 'com.apple.product-type.bundle.unit-test', but there's no such product type for the 'iphoneos' platform
Run Code Online (Sandbox Code Playgroud)

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

Ale*_*lav 104

看起来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-testwith的任何实例com.apple.product-type.bundle.现在,只要您使用Xcode 6打开项目,然后想要在Xcode 5中打开它,就需要执行此操作.

  • 这需要赚取的不仅仅是投票.原始海报需要将此作为答案. (2认同)