From cocoachina: http://www.cocoachina.com/bbs/read.php? Tid = 8466 & keyword = % be % B2 % CC % AC % C0 % E0 % BF % E2
(1) create a static class library
• Simplified for ease of explanation, which is more convenient and initialCodeTest, create a project, staticlibraryexample
• New target is created for worker. Suppose we want to makeStatic class libraryName: imibase. Right-click targets and add a new target. Select static library and name it imibase
• Add a class file to imibase. Note that the target to be added is imibase, rather than the default staticlibraryexample.
• Compile writes a method printaaa to print the string AAA.
• Benchmark Testing. Double-click target staticlibraryexample, add a direct dependency in general, and select imibase. The purpose is to ensure that imibase is compiled every time you run the test. After completion, the command + B is compiled. We will find two products in the products smart folder. One is staticlibraryexample. app, and the other is libimibase. A. The latter is what we need.Static class libraryThe default prefix is the file with the Lib suffix.. (Note that the. A file will be ignored by SVN by default. Use Google SVN for configuration ). Drag the. A file to the link binary with libraries folder of target staticlibraryexample.
(2) Use lipo to compile and merge static class libraries for iPhone simulators and real machines
Assume that the two versions of LIB are libimiui. s. A and libimiui. d. a. Our goal is to merge them into the invincible super general version of libimiui..
Open the command line terminal. app and enter:
Lipo-create
Then drag the two. A files to the terminal window in sequence, and the command line will become like this:
Lipo-create/users/Travis/desktop/libimiui. d. A/users/Travis/desktop/libimiui. S.
Then enter the path of the-output target file, for example:
-Output/users/Travis/desktop/libimiui.
The following command is used:
Lipo-create/users/Travis/desktop/libimiui. d. A/users/Travis/desktop/libimiui. s. A-output/users/Travis/desktop/libimiui.