2

我有一个 iOS 项目。它也可以在我的 iPhone 和 iPad 上运行。现在我想在终端中使用xcodebuild. 但我得到错误,它喜欢这样:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c-header -arch armv7 -fmessage-length=0 -Wno-trigraphs -fpascal-strings -Os -Wno-missing-field-initializers -Wmissing-prototypes -Wno-return-type -Wno-implicit-atomic-properties -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-sign-compare -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -Wprotocol -Wdeprecated-declarations -g -fvisibility=hidden -Wno-conversion -Wno-sign-conversion -mthumb "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -miphoneos-version-min=3.2 -I/Users/zhangyangjing/Desktop/556/Tabster/build/Tabster.build/Release-iphoneos/Tabster.build/Tabster.hmap -I/Users/zhangyangjing/Desktop/556/Tabster/build/Release-iphoneos/include -I/Users/zhangyangjing/Desktop/556/Tabster/build/Tabster.build/Release-iphoneos/Tabster.build/DerivedSources/armv7 -I/Users/zhangyangjing/Desktop/556/Tabster/build/Tabster.build/Release-iphoneos/Tabster.build/DerivedSources -F/Users/zhangyangjing/Desktop/556/Tabster/build/Release-iphoneos --serialize-diagnostics /var/folders/34/1khlf2gx2t5bkm3llcs1mhmr0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/Prefix-dnpnglnqyykokvgarilsbxpvuaap/Prefix.pch.dia -c /Users/zhangyangjing/Desktop/556/Tabster/Prefix.pch -o /var/folders/34/1khlf2gx2t5bkm3llcs1mhmr0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/Prefix-dnpnglnqyykokvgarilsbxpvuaap/Prefix.pch.pth -MMD -MT dependencies -MF /var/folders/34/1khlf2gx2t5bkm3llcs1mhmr0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/Prefix-dnpnglnqyykokvgarilsbxpvuaap/Prefix.pch.d
In file included from /Users/zhangyangjing/Desktop/556/Tabster/Prefix.pch:2:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:38:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:108:16: fatal error: 'CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h' file not found
      #include <CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h>

** BUILD FAILED **

以下构建命令失败:

ProcessPCH /var/folders/34/1khlf2gx2t5bkm3llcs1mhmr0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/Prefix-dnpnglnqyykokvgarilsbxpvuaap/Prefix.pch.pth Prefix.pch normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

我已经尝试过 Apple 的演示项目,他们也遇到了同样的错误。我疯了,谁能帮帮我?

4

1 回答 1

0

我解决它。做就是了:

cd /usr/bin
rm xcodebuild
ln -s /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild xcodebuild
于 2012-07-05T02:55:06.087 回答