不能执行'codesign'(没有这样的文件或目录)

时间:2013-09-16 12:52:50

标签: iphone ios xcode ios7 xcode5

尝试在使用Xcode 5

的设备上运行应用时出现此错误

这是完整的错误

CodeSign /Users/Nevo/Library/Developer/Xcode/DerivedData/RecipesBook-efcrcmgnkaitsqaxahtumfbdxtmb/Build/Products/Debug-iphoneos/RecipesBook.app
    cd "/Users/Nevo/Desktop/RecipesBook for ios 7 and 6"
    setenv CODESIGN_ALLOCATE "/Applications/Xcode 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate"
    setenv PATH "/Applications/Xcode 2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode 2.app/Contents/Developer/usr/bin‭:‬‭/‬usr/bin‭:/‬bin‭:/‬usr/sbin‭:/‬sbin"
    Using code signing identity "iPhone Distribution: Shay Shalev (QN94KCWC64)" and provisioning profile "ProfileRecipeBook" (52D189D8-2FFD-4939-A3C6-1CD1F8B645E0)
    codesign --force --sign 4F0E5397A87B47EE07EC3288681661CBCBB4781C --resource-rules=/Users/Nevo/Library/Developer/Xcode/DerivedData/RecipesBook-efcrcmgnkaitsqaxahtumfbdxtmb/Build/Products/Debug-iphoneos/RecipesBook.app/ResourceRules.plist --entitlements /Users/Nevo/Library/Developer/Xcode/DerivedData/RecipesBook-efcrcmgnkaitsqaxahtumfbdxtmb/Build/Intermediates/RecipesBook.build/Debug-iphoneos/RecipesBook.build/RecipesBook.xcent /Users/Nevo/Library/Developer/Xcode/DerivedData/RecipesBook-efcrcmgnkaitsqaxahtumfbdxtmb/Build/Products/Debug-iphoneos/RecipesBook.app

error: can't exec 'codesign' (No such file or directory)

3 个答案:

答案 0 :(得分:5)

我从codesign复制了/usr/bin/ 至: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/u‌​sr/bin

它对我有用。

答案 1 :(得分:0)

解决了我的问题,谢谢你的帮助。问题出在我的道路上。我已经通过/etc/launchd.conf设置了我的路径,我正在疯狂地试图通过〜/ .bashrc等编辑我的路径。确保/ usr / bin在xcode选择的路径中。这个页面提醒我: http://overwatering.org/blog/2012/08/setting-path-osx-mountain-lion/

答案 2 :(得分:0)

我是使用cpp的新手,因此,我确定该解决方案不适用于所有人,并且我相信在某些情况下有很多理由不这样做。

我的解决方案是禁用签名:

构建设置>>签名>>代码签名身份>>将此设置为“不进行代码签名”