在 XCode 4 中为 iPhone 模拟器构建静态库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7744663/
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
Build Static Library in XCode 4 for iPhone Simulator
提问by tacos_tacos_tacos
I can build a static library in XCode 4 using the iOS Device scheme but not the iPhone Simulator scheme. It says "Build succeeded" but I do not see the requisite .a file magically appear under Products. If I choose the iOS Device scheme I see the .a file. I know I'm missing something obvious here, please help!
我可以使用 iOS 设备方案而不是 iPhone 模拟器方案在 XCode 4 中构建静态库。它说“构建成功”,但我没有看到必需的 .a 文件神奇地出现在产品下。如果我选择 iOS 设备方案,我会看到 .a 文件。我知道我在这里遗漏了一些明显的东西,请帮忙!
采纳答案by Johnnywho
Check your build directory, if there's a *.a file in Release-iphonesimulator and Release-iphoneos then everything should be fine. But do you really need to use separate schemes? Here's very good guide to static libraries on Xcode 4. This guide describes how to make libraries universal, so *.a files for simulator and device are merged into one single file.
检查您的构建目录,如果 Release-iphonesimulator 和 Release-iphoneos 中有 *.a 文件,那么一切都应该没问题。但是你真的需要使用单独的方案吗?这是 Xcode 4 上静态库的非常好的指南。本指南介绍了如何使库通用,因此模拟器和设备的 *.a 文件合并为一个文件。