How to enable XCode to build Dynamic Libraries for the iPhone


When XCode is installed it doesn't have the ability to create dynamic libraries using the iPhone SDK. If you create a new Mac OS X Cocoa Dynamic Library project and then in project settings change the base SDK to Device - iPhone OS 2.2, when you build you will see the error:

target specifies product type 'com.apple.product-type.library.dynamic', but there's no such product type for the 'iphoneos' platform

To fix this, first install Plist edit Pro then open terminal and type:

sudo chmod -R 777 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Specifications/

open /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Specifications/MacOSX\ Product\ Types.xcspec

Search for
Dynamic Library. Copy that whole dictionary.

open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Specifications/iPhoneOSProductTypes.xcspec

Right click Root and paste as child.

Then:

open /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Specifications/MacOSX\ Package\ Types.xcspec

Search for Dynamic Library and copy the whole dictionary.

open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Specifications/iPhoneOSPackageTypes.xcspec

Right click Root and paste as child.

You will have to repeat this every time you install a new Xcode.