1

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)
Chris Truman
  • 913
  • 1
  • 7
  • 25
נבו שלו
  • 81
  • 2
  • 7
  • I have this same error, have you found anything? Seems like a path issue. – Chris Truman Sep 16 '13 at 22:24
  • Duplicate with more info http://stackoverflow.com/questions/18838378/xcode-5-error-cant-exec-codesign-no-such-file-or-directory – Chris Truman Sep 16 '13 at 22:36
  • 1
    I see you have a space in your Xcode app name. Some scripts have a hard time dealing with spaces, so I would suggest removing it. I don't know if that's what is actually causing the issue though, but it's worth a shot. – BergQuester Sep 17 '13 at 04:50

3 Answers3

5

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

and it worked for me.

Abdullah Umer
  • 4,234
  • 5
  • 36
  • 65
0

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/

Chris Truman
  • 913
  • 1
  • 7
  • 25
  • 1
    Could you please explain how that link worked for you? I'm getting: setenv: command not found – Abdullah Umer Sep 26 '13 at 21:22
  • you can't run setenv in terminal, you need to make sure your path includes codesign. run "which codesign", then make sure your $PATH includes that. – Chris Truman Sep 26 '13 at 21:27
  • here's what i did,, which codesign /usr/bin/codesign Abdullahs-MacBook-Pro:~ abdullahumer$ cat $PATH cat: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin: No such file or directory Abdullahs-MacBook-Pro:~ abdullahumer$ PATH=$PATH:/usr/bin/codesign Abdullahs-MacBook-Pro:~ abdullahumer$ cat $PATH cat: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin/codesign: No such file or directory – Abdullah Umer Sep 26 '13 at 21:37
  • Xcode's path is not the same as your terminal path. It could be changed elsewhere. check /etc/launchd.conf and ~/.MacOSX/environment.plist as mentioned in the link – Chris Truman Sep 26 '13 at 21:44
  • 4
    ok its done now. I copied codesign from /usr/bin/ to /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin and it worked for me. – Abdullah Umer Sep 26 '13 at 21:49
  • fixing the path is what you should do – Daij-Djan Sep 26 '13 at 22:17
0

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"