从理论上讲,我们似乎可以构建一个包含模拟器、iPhone和iPad的单一静态库。
然而,苹果没有我能找到的关于这方面的文档,Xcode的默认模板也没有配置这样做。
我正在寻找一个简单的,可移植的,可重用的技术,可以在Xcode中完成。
一些历史:
在2008年,我们曾经能够制作包含sim卡和设备的单个静态库。苹果禁用了这个功能。 整个2009年,我们做了一对静态库-一个用于sim,一个用于设备。苹果现在也禁用了这个功能。
引用:
This is a great idea, it's an excellent approach, but it doesn't work: http://www.drobnik.com/touch/2010/04/universal-static-libraries/ There's some bugs in his script that means it only works on his machine - he should be using BUILT_PRODUCTS_DIR and/or BUILD_DIR instead of "guesstimating" them) Apple's latest Xcode prevents you from doing what he's done - it simply will not work, due to the (Documented) change in how Xcode processes targets) Another SO questioner asked how to do it WITHOUT xcode, and with responses that focussed on the arm6 vs arm7 part - but ignored the i386 part: How do i compile a static library (fat) for armv6, armv7 and i386 Since Apple's latest changes, the Simulator part isn't the same as the arm6/arm7 difference any more - it's a different problem, see above)