Xcode创建动态库

1.用Xcode打开如下2个xcspec文件:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Specifications/iPhoneOSPackageTypes.xcspec
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Specifications/MacOSX Package Types.xcspec

2.把MacOSX Package Types.xcspec中Identifier为com.apple.package-type.mach-o-dylib的item复制到iPhoneOSPackageTypes.xcspec

3.把MacOSX Product Types.xcspec中Identifier为com.apple.product-type.library.dynamic的item复制到iPhoneOSProductTypes.xcspec

以上为真机,模拟器类似,路径在:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Specifications/

 

1.把/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/Project Templates/Framework & Library/Cocoa Touch Static Library.xctemplate整个文件夹复制并改名为Cocoa Touch Dynamic Library.xctemplate

2.修改Description中的"a static library"为"a dynamic library"
修改Identifier中的"cocoaTouchStaticLibrary"为"cocoaTouchDynamicLibrary"
修改Description中的".static"为".dynamic"

 

1.Installation Directory设置为@executable_path/

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注