In the many open source of the Great God's blog is organized as follows: (Tested OK)
First, describe
Build Activearchitecture only set to Yes;
Architectures by Xcode default configuration, arm64 forward compatible;
To make. A static library, you need to ensure compatibility, including different iOS devices and emulator run error, so as far as possible to achieve maximum compatibility.
Validarchitectures set to: armv7|armv7s|arm64|i386|x86_64
Second, the text guide
1. Open Xcode, click File\new\project, select Ios\framework andlibrary\cocoa Touch Static library to create a new static libraries project.
2. The project name is at the discretion of its own needs.
3. All the xxx.h and xxx.m that need to be encapsulated are introduced into the project.
4. Introduce the header file.
5. Generate Static Library: Divided into 2 kinds of mobile phone and simulator (mobile phone only can call, simulator only can be adjusted)
1> generate emulator Static library, after generation, right-click a file, select Show in Finder to view;
2> generate the phone static library, after the generation, right-click a file, select Show in Finder can be viewed;
6. Open the terminal and use the following command to synthesize it to the desktop for easy access.
Lipo-create Simulator. A path in the real machine. a path-output/users/mac/desktop/libxxx.a
For example:
Lips (here is the space, no brackets)-create (here is the space, no brackets)/users/mac/library/developer/xcode/deriveddata/ staticlibrarynamesdk-fgfhddoykewmwkdnsmoesvcphdsk/build/products/debug-iphonesimulator/ LIBSTATICLIBRARYNAMESDK.A (here is the space, no brackets)/users/mac/library/developer/xcode/deriveddata/ STATICLIBRARYNAMESDK-FGFHDDOYKEWMWKDNSMOESVCPHDSK/BUILD/PRODUCTS/DEBUG-IPHONEOS/LIBSTATICLIBRARYNAMESDK.A ( Here is the space, no brackets)-output (here is the space, no brackets)/users/mac/desktop/libstaticlibrarynamesdk.a
After entering, enter, you can build on the desktop. A is what you need.
iOS code encapsulated as. A files (Package SDK)