codesign_allocate:错误:无法找到实用程序" codesign_allocate",不是开发人员工具或PATH

时间:2015-04-24 13:20:14

标签: ios xcode codesign

我昨天将Mac升级到10.10.3,Xcode升级到6.3.1;今天我不能使用git,codesign_allocate ....等等。

`sh: line 1: 18421 Abort trap: 6           /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk -find codesign_allocate 2> /dev/null
codesign_allocate: error: unable to find utility "codesign_allocate", not a developer tool or in PATH
/Users/ylx/Library/Developer/Xcode/DerivedData/test-ahpvhmtqeafuveekexklyxulvmfa/Build/Products/Debug-iphoneos/test.app/Frameworks/libswiftCore.dylib: the codesign_allocate helper tool cannot be found or used
*** error: Couldn't codesign /Users/ylx/Library/Developer/Xcode/DerivedData/test-ahpvhmtqeafuveekexklyxulvmfa/Build/Products/Debug-iphoneos/test.app/Frameworks/libswiftCore.dylib: codesign failed with exit code 1
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-stdlib-tool failed with exit code 1`

4 个答案:

答案 0 :(得分:1)

我几乎整个下午都在挣扎,并开始认为这对我来说是最终的。

希望我找到了一个可以帮助其他人的解决方案。我一次又一次地看到这个错误后开始怀疑:

sh: line 1: 18421 Abort trap: 6 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk -find codesign_allocate 2> /dev/null codesign_allocate: error: unable to find utility "codesign_allocate", not a developer tool or in PATH

我拿了@ sandy的答案并检查了我可以找到codesign_allocate的不同路径。运行这两个命令后,我得到了很好的提示:

$ /usr/bin/codesign_allocate sh: line 1: 26890 Abort trap: 6 ...

$ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate Usage: .../codesign_allocate -i input [-a <arch> <size>] [-A <cputype> <cpusubtype> <size>]... -o output

因此,我只是将我的本地/usr/bin/codesign_allocate替换为xcode中的那个,并修复了我的所有问题。

sudo cp -r /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate /usr/bin/

我希望这可以帮助其他人;祝大家好运。

答案 1 :(得分:0)

升级到Xcode 6.4为我修复了它。

答案 2 :(得分:0)

有时问题是Xcode命令行工具的路径,可以通过修复XCode的路径来修复。请使用命令 xcode-select -p 检查XCode的路径。如果它显示不正确的XCode路径,那么您可以使用命令   sudo xcode-select -s PATH_TO_XCODE_DEVELOPER_FOLDER

例如, sudo xcode-select -s“/Application/XCode.app/Contents/Developer”

答案 3 :(得分:0)

清理+重新打开为我工作的xcode