Packaging a static library process
1. Create a static library
2. Implementation class
3. Open the. h file
4. Packaging Simulator Static Library
5. Packaging the true machine static library
6. Merging simulators and real-machine static libraries
7. Test the Static library
First, pre-work
1, new. A Static library project
2. Implement classes that need to be packaged
3. Add headers
4, then find Heaers (0 items) column, dot + add header file
5. Then add the header files that need to be exposed
6, after adding, the header file will appear in the Project column, you need to manually push into the public column to open
7. After drag-in, the header file in public is the open header file
Second, set scheme
1. Choose Edit Scheme
2. Compile the emulator version of the. a static library. Select simulator
3, after the selection of the simulator to compile, after the successful compilation, the products in the LIBENCRYPTION.A will be red into black
4. A static library that compiles a real machine version. Select a real machine
Third, merge the analog version and these versions of the static library
1. Select Libencryption.a, right-click the show in Finder
2. After entering the folder directory, you can see the compiled emulator and the real machine version. A static file
3, open the terminal, use the command in the version of the merge, the specific format for
lipo -create "真机版本.a静态库路径" "模拟器版本.a静态库路径" -output "合并后的.a静态库路径”
Four, finally can test the static library
1. Drag the edited static library and. h file into the project
This is the entire process of packaging a static library
Reference Link: http://www.jianshu.com/p/add59ec093b6
iOS packaging. A static library step