Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build Static Library in XCode 4 for iPhone Simulator

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!

like image 663
tacos_tacos_tacos Avatar asked Oct 12 '11 18:10

tacos_tacos_tacos


People also ask

How do I create a static library in Xcode?

Open XCode and start a new project. Under iOS, select Library and “Cocoa Touch Static Library” say it as "staticlibrary". This will create a nice new project for us that builds a . a file.

Is XCFramework static or dynamic?

An XCFramework can be either static or dynamic and can include headers.

Does CloudKit work in simulator?

CloudKit does not work with Simulator.

What is static library iOS?

Posted 4 years ago by. Static libraries and frameworks are different kinds of things. A static library is a collection of compiled object files combined into a single library file, that may be linked into an app or framework target just like single object files are linked.


1 Answers

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.

like image 78
Johnnywho Avatar answered Oct 17 '22 17:10

Johnnywho