How do I change an existing Xcode target from dynamic to static?
xcode, xcodebuild
Solution
Opens up the project.pbxproj file in YourProjectName.xcodeproj folder using TextEdit, search for productType and change it's value from "com.apple.product-dynamic" to "com.apple.product-static"
Problem
I'm working with an existing project that produces a dynamic library (Cocoa API). I'd rather generate a static library, but if I change the [Linking|Mach-O Type] field from "Dynamic Library" to "Static Library", both the Clean Project and Build Project complain that the target has an invalid `MACH_O_TYPE` value of 'staticlib'. Is there a straightforward way to get the build to produce a static .a file? Thanks, Eric