Xcode 5“错误:不能执行'codesign'(没有这样的文件或目录)"
最近有人在无法执行' '(没有这样的文件或目录)
然而,无论出于何种原因,它已经收到了投票而不是有用的东西。因此,我将尝试自己发布这些信息,并附上一些额外的数据,希望通过这种方式可以解决问题。或者只知道问题所在。
However, for whatever reason, it has received a down-vote rather than something helpful. So I am going to try to post this myself, with some additional data in hopes that some kind SO'er has been through this or just knows what the problem is.
我有一个在Xcode 4.x下构建良好的项目,但自从安装Xcode 5 DP2(和DP3,4和5)以及现在已发布的版本后,我在尝试构建或存档到模拟器以外的任何内容时出现此错误:
I have a project that builds fine under Xcode 4.x, but ever since installing Xcode 5 DP2 (and DP3,4 and 5) and now the released version, I get this error when trying to build or archive to anything but the simulator:
CodeSign /Users/cb/Library/Developer/Xcode/DerivedData/MyApp-bdtrjmwxxokvesathmrttgwwesfq/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app
cd /Users/cb/Development/MyAppCore/FrontEnd/Mobile/iOS/MyApp
setenv CODESIGN_ALLOCATE /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:$PATH:/usr/local/mysql/bin:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin"
Using code signing identity "iPhone Developer: CB (D4HZSHL6DF)" and provisioning profile "MyApp_DEV" (BB1C0589-147E-4E12-945D-8FB093B70C70)
codesign --force --sign F5...B73 --resource-rules=/Users/cb/Library/Developer/Xcode/DerivedData/MyApp-bdtrjmwxxokvesathmrttgwwesfq/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app/ResourceRules.plist --entitlements /Users/cb/Library/Developer/Xcode/DerivedData/MyApp-bdtrjmwxxokvesathmrttgwwesfq/Build/Intermediates/ArchiveIntermediates/MyApp/IntermediateBuildFilesPath/MyApp.build/Release-iphoneos/MyApp.build/MyApp.xcent /Users/cb/Library/Developer/Xcode/DerivedData/MyApp-bdtrjmwxxokvesathmrttgwwesfq/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app
如果我打开终端并cd到
If I open Terminal and cd to
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/
and然后从那里运行命令,它执行得很好。因此,工具似乎没有问题,配置文件也是如此。问题似乎与Xcode本身有关。
and then run the command from there, it executes just fine. So the tools seem alright, as do the provisioning profiles. The problem seems to be with Xcode itself.
应该注意的是,我已经完全删除了Xcode,以及我的代码库,以及所有配置文件和证书。我重新检查了我的代码,并从新下载中重新安装了Xcode 5,将Apple ID输入Xcode并重新创建/获取了证书和配置文件,但仍然存在同样的问题。
It should be noted that I have deleted Xcode completely, as well as my codebase, along with all provisioning profiles and certs. I re-checked-out my code, and re-installed Xcode 5 from a fresh download, entered Apple ID into Xcode and re-created/fetched the certs and profiles, and still have the same issue.
我也进入了项目文件本身并根据我找到的几个答案删除了重复的PROVISIONING_PROFILE条目,但没有用。
I also went in to the project file itself and removed duplicate PROVISIONING_PROFILE entries per a couple of answers I found, to no avail.
I可以使用Xcode 5从其他2台机器上构建同一个项目,所以它是专门在我的盒子上发生的,或者我的特定安装,它似乎。但除此之外,我很难过。
I can build this same project from 2 other machines using Xcode 5, so it is something happening specifically on my box, or with my particular installation, it would seem. But other than that, I am stumped.
有没有人看过/修过这个,或者有任何关于在哪里寻找答案的想法?
Has anyone seen/fixed this, or have any ideas of where to look for an answer?
感谢您的任何输入!
试试这个:
对于开始签名过程之前的Mountain Lion请在第一个命令下运行以下命令。
For Mountain Lion before starting signing process Please run below command as first command.
对于Xcode 4.x:
export CODESIGN_ALLOCATE = /Applications/Xcode.app/Contents/Developer/usr/bin/codesign_allocate
For Xcode 4.x: export CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/usr/bin/codesign_allocate"
对于XCode 5:
export CODESIGN_ALLOCATE =/ Applications / Xcode.app /Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
For XCode 5: export CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate"