can't exec 'codesign' (No such file or

2019-07-23 22:40发布

I get this error when tying to run an app on a device with Xcode 5

here is the full error

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条回答
趁早两清
2楼-- · 2019-07-23 23:05

Solved my problem, thanks for the help. The issue was with my path. I had set my path via /etc/launchd.conf and I was driving myself insane trying to edit my path via ~/.bashrc etc. Make sure /usr/bin is in the path that xcode picks up. This page reminded me: http://overwatering.org/blog/2012/08/setting-path-osx-mountain-lion/

查看更多
Lonely孤独者°
3楼-- · 2019-07-23 23:26

I'm a newb with cpp so I am sure that this solution won't work for everyone and I am sure there are many reasons not to do this in certain situations.

My solution was to disable signing:

Build settings >> Signing >> Code Signing Identity >> set this to "Don't Code Sign"

查看更多
爷的心禁止访问
4楼-- · 2019-07-23 23:27

I copied codesign from /usr/bin/ to: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/u‌​sr/bin

and it worked for me.

查看更多
登录 后发表回答