Ios XCode代码标记错误XCTest

Ios XCode代码标记错误XCTest,ios,xcode,xcode6,code-signing-certificate,Ios,Xcode,Xcode6,Code Signing Certificate,当我尝试在模拟器上运行我的应用程序时,一切正常。但是,当我尝试构建它以在真实设备上进行测试时,我得到以下错误: CodeSign /Users/fvoordeckers/Library/Developer/Xcode/DerivedData/MyProject-##########/Build/Products/Debug-iphoneos/MyProject.xctest cd /Users/fvoordeckers/Documents/Projecten/MyProject/iOS expo

当我尝试在模拟器上运行我的应用程序时,一切正常。但是,当我尝试构建它以在真实设备上进行测试时,我得到以下错误:

CodeSign /Users/fvoordeckers/Library/Developer/Xcode/DerivedData/MyProject-##########/Build/Products/Debug-iphoneos/MyProject.xctest
cd /Users/fvoordeckers/Documents/Projecten/MyProject/iOS
export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"

Signing Identity:     "iPhone Developer: Frederik (########)"

/usr/bin/codesign --force --sign ##################/Users/fvoordeckers/Library/Developer/Xcode/DerivedData/MyProject-##########/Build/Products/Debug-iphoneos/MyProject.xctest

/Users/fvoordeckers/Library/Developer/Xcode/DerivedData/MyProject-##########/Build/Products/Debug-iphoneos/MyProject.xctest: bundle format unrecognized, invalid, or unsuitable

Command /usr/bin/codesign failed with exit code 1

我用
#
更改了ID。我创建了一个配置文件,其中包括我正在使用的设备和所有必需的证书。应用程序似乎没有问题,但XTest。。。我还尝试将“--deep”标志添加到签名配置中,但没有帮助…

在xcode->inBuild Target->in->完全删除MyProject.xctest或取消选中MyProject.xctest的所有框


清理您的项目,然后在设备上运行我遇到了同样的问题,但没有任何帮助(更新方案、更改配置文件或代码签名标识等)除了将Xcode更新到最新的测试版:Xcode 7.3 beta 4


我猜苹果在这个新版本中做了一些重大改进:)

你是否在项目级、应用程序目标级或测试目标级更改了构建设置?如果我没有
MyProject.xctest
,但仍然得到相同的错误?你能解释为什么吗?谢谢–我可以确认,如果您忽略清理构建,那么即使您取消选中各种框,此错误仍然会持续。清理构建可以让您克服错误。