使用xcodebuild构建时出错

我有一个
xcode Objective-C iPhone静态库项目.当我在xcode中构建它时,我没有错误或警告.但是当我从命令行使用xcodebuild构建它时,我得到:

"/Developer/usr/bin/gcc" -v -dM -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk -E -arch armv6 -o - -x objective-c /dev/null
gcc-4.2: error trying to exec '/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1': execvp: No such file or directory

我找不到任何能帮助我理解问题是什么的东西,任何想法?

是的/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1文件确实存在:-)

最佳答案 出于某种原因,似乎为我解决这个问题的实际情况是传递给要使用的架构.

例如,此命令失败:

/Developer-SDK4/usr/bin/xcodebuild -target ProjectName -configuration Release build PLATFORM_NAME=iphonesimulator BUILDSDK=/Developer-SDK4

但是这个有效:

/Developer-SDK4/usr/bin/xcodebuild -target ProjectName -configuration Release build PLATFORM_NAME=iphonesimulator BUILDSDK=/Developer-SDK4 ARCHS=i386

注意,这对我来说在构建模拟器时失败了.对设备的构建似乎工作得很好.

点赞