当我尝试在模拟器上运行我的应用程序时,一切正常。但是,当我尝试构建它以在真实设备上对其进行测试时,出现以下错误:
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。我创建了一个配置文件,其中包括我正在使用的设备和所有必需的证书。应用程序似乎没有问题,但 xctest 没有问题...我还尝试将“--deep”标志添加到签名配置中,但没有帮助...
最佳答案
在 xcode 中转到 Edit Scheme -> 在 Build Target -> 完全删除 MyProject.xctest 或取消选中 MyProject.xctest 的所有框分析、测试等。
清理您的项目,然后在设备上运行。
关于ios - XCode代码签名错误XCTest,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27482680/