How to generate your own SDK for iOS (.framework)

  Here I recommend two link addresses written by others:

https://www.jianshu.com/p/6c033c39884a and http://blog.csdn.net/dp948080952/article/details/52749120

The following is a summary of the essence of my SDK creation process (easy mistakes):

1. The resource file .bundle cannot be packaged in .framework and must be packaged separately;

2. Do not package the category files into it;

3. When building the project file, the building setting should be set well, because the simulator needs to support 64bit, x86_64 must be added to the valid architectures;

4. Compile the framework of the real machine and the simulator with the simulator and the real machine (iOS device) respectively;

5. Then merge the two frameworks, the code reference is as follows:

lipo -create /Users/zhang-zitong/Library/Developer/Xcode/DerivedData/JCSIGNSDK-fsgnbkgmupgyhtahxhtgqykzroys/Build/Products/Debug-iphonesimulator/JCSIGNSDK.framework/JCSIGNSDK /Users/zhang-zitong/Library/Developer/Xcode/DerivedData/JCSIGNSDK-fsgnbkgmupgyhtahxhtgqykzroys/Build/Products/Debug-iphoneos/JCSIGNSDK.framework/JCSIGNSDK -output /Users/zhang-zitong/Desktop/JCSIGNSDK

6. If the production depends on a third party such as: afnetworking or fmdb, etc., it needs to be imported with cocoapod, otherwise it will conflict with af and fmdb in the new project if it is added to the new project.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325954910&siteId=291194637