xcode 使用 xcodebuild 构建时出错
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2979163/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error when building using xcodebuild
提问by drekka
I have an xcode Objective-C iPhone static library project. When I build it in xcode I get no errors or warnings. But when I build it using xcodebuild from the command line I get:
我有一个 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
I cannot find anything that helps me to understand what the issue is, any ideas?
我找不到任何可以帮助我理解问题所在的东西,有什么想法吗?
And yes the /Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1 file does exist :-)
是的,/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1 文件确实存在:-)
采纳答案by nivekastoreth
For some reason what seemed to fix this for me is actually passing in the architectures to be used.
出于某种原因,似乎对我来说解决这个问题的方法实际上是传入要使用的架构。
For instance, this command fails:
例如,此命令失败:
/Developer-SDK4/usr/bin/xcodebuild -target ProjectName -configuration Release build PLATFORM_NAME=iphonesimulator BUILDSDK=/Developer-SDK4
But this one works:
但是这个有效:
/Developer-SDK4/usr/bin/xcodebuild -target ProjectName -configuration Release build PLATFORM_NAME=iphonesimulator BUILDSDK=/Developer-SDK4 ARCHS=i386
Note, this only failed for me when building against the simulator. Building against the device seemed to work just fine.
请注意,这仅在针对模拟器构建时对我来说失败了。对设备进行构建似乎工作得很好。