目标指定产品类型 'com.apple.product-type.bundle.ui-testing',但 'iphonesimulator' 平台没有此类产品类型

target specifies product type 'com.apple.product-type.bundle.ui-testing', but there's no such product type for the 'iphonesimulator' platform

当我 运行 我的 swift 项目时,我遇到了这个错误。

target specifies product type 'com.apple.product-type.bundle.ui-testing', but there's no such product type for the 'iphonesimulator' platform

我在 SO 上发现了一些类似的问题,但是 this answer didn't solve my problem. I googled 它也是,里面没有这个产品类型的项目。

我正在使用 xcode 6.4 和 swift 1.2

在使用 Xcode 7 Beta 为 UI 测试添加产品并不断在 Xcode 6.4 和 7 Beta 之间切换后,我遇到了这个问题。一个简单的 clean 让它消失了。

就我而言,clean 不起作用。

打开AppName.xcodeproj/project.pbxproj,将所有 com.apple.product-type.*(有3个)替换为com.apple.product-type.application解决了我的问题。

apple 似乎在 Xcode 7.

中更改了类型名称