[Go] iOS development use Lipo command to make simulator and real machine General Static library

Source: Internet
Author: User

Transfer from http://blog.csdn.net/jinglijun/article/details/8276089

There are usually two versions of the static library used in the project, one for the simulator and one for the real machine, because the Mac and IPhone have different CPUs.

For the convenience of switching between the simulator and the real machine, it is necessary to make a generic version.

There are now two versions of the static library libsqlite_i386.a(simulator) with LIBSQLITE_ARM.A(real machine).

1. Open the terminal and enter the directory where the two files are located;

2, execution: lipo-create libsqlite_i386.a libsqlite_arm.a-output libsqlite.a, then the file will be more than Libsqlite.a, this file is a general static library.

We can lipo-info the LIBSQLITE.A command to see if it is generic.

It can be found that the size of the LIBSQLITE.A is libsqlite_i386.a and libsqlite_arm.a, and it is recommended to replace the static library with the real machine version when publishing.


ThatWhat the hell is Lipo?

from Mac system to make compatible Powerpc platform program.

Lipo is a tool that handles generic programs (Universal Binaries) in Mac OS x. Many (almost all) programs that are now on sale or available for download are marked with "Universal", meaning they both have code that PowerPC and Intel chips can handle. But since you probably don't care about one of them, you can use Lipo to "Slim Down" your program . For example, you want the notes application to contain only Intel (i386) code:

Cd/applications

Lipo Stickies.app/contents/macos/stickies-thin I386-output stickies.app/contents/macos/stickies.i386

CD stickies.app/contents/macos/

RM stickies

MV Stickies.i386 Stickies

[Go] iOS development use Lipo command to make simulator and real machine General Static library

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.