XCode获取“目标指定产品类型'com.apple.product-type.bundle.unit-test',但'iphoneos'平台没有这样的产品类型” [英] 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中运行我的项目时,我的测试会出现此错误:
When running my project in XCode, my tests gives this error:
target specifies product type 'com.apple.product-type.bundle.unit-test', but there's no such product type for the 'iphoneos' platform
它发生在几次XCode更新之后。有谁知道如何解决这个问题?
It happened after a couple of XCode updates. Does anyone know how to fix this?
推荐答案
看起来Xcode 6改变了来自<$ c的ocunit测试包的产品标识符$ c> com.apple.product-type.bundle 到 com.apple.product-type.bundle.ocunit-test
。
It looks like Xcode 6 changed the product identifier for ocunit test bundles from com.apple.product-type.bundle
to com.apple.product-type.bundle.ocunit-test
.
编辑 $(ProjectName).xcodeproj / project.pbxproj
并替换 com.apple的任何实例.product-type.bundle.ocunit-test
with com.apple.product-type.bundle
。现在,只要您使用Xcode 6打开项目,然后想要在Xcode 5中打开它,就需要这样做。
Edit $(ProjectName).xcodeproj/project.pbxproj
and replace any instance of com.apple.product-type.bundle.ocunit-test
with com.apple.product-type.bundle
. For now you will need to do this any time you open your project with Xcode 6 and then want to open it in Xcode 5.
这篇关于XCode获取“目标指定产品类型'com.apple.product-type.bundle.unit-test',但'iphoneos'平台没有这样的产品类型”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!