Create, use lipo to compile and merge static class libraries for iPhone simulators and real machines

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.