Package and debug static libraries (2), package and debug static libraries

Source: Internet
Author: User

Package and debug static libraries (2), package and debug static libraries

The last lecture...

1. the last time I said that the static library of the real machine can only be used on the real machine, and the static library of the simulator can only be used on the simulator. So let's first talk about the generation of the real machine and simulator. after static library a, how can we avoid dragging the static library of the real machine and simulator back and forth to the project, that is, directly dragging a static library.

Solution: use command line statements

1. Switch the path to the Products directory.

      

2. Merge static databases

      

This command line is not difficult to understand. I will give you a general idea about the static library name after the static library 1 to be merged in lipo-create and the static library 2-output to be merged. Note that, saved to the current directory by default.

       

 

In this way, the merged static library is ready. You only need to replace the static library in lib with the static library of staticDemo. a, and then drag it into your project to use it at will. However, because it is a static database merged, the size must be larger than before the merge, and your project will also grow, therefore, it is best to package real projects as needed. Here we just tell you that such a solution can be solved and can be used normally.

2. As shown in the previous figure, we can notice that all the static library folders we generated are Debug-xxx. This Debug represents debugging, and there is also a Release status. How can we generate it?

Then, Execute Command + B on the simulator and on the real machine respectively to generate the Command. The output is as follows:

      

The use of Release is basically the same as that of Debug. What are the differences between them ???

The more serious statement is:

The debug version contains complete symbolic information and does not optimize the code.

The released version does not contain complete symbolic information, and the code is optimized.

The general saying is: the debug version will execute printing statements such as NSLog in your program, but the release version will not.

3. debug the static library

Now, run Command + R and two errors will occur.

      

How can this problem be solved? (After the solution is completed, we can debug our static library functions)

It's easy, just configure it,

        

After adding these two items, it's really OK!

4. The steps for packaging. framework and. a are similar. When I have time to update a. framework, just pay attention to it.

The difference between. framework and. a is that. framework does not require you to manually drag. h and bundle to your folder and will be automatically generated.

Package and debug the static library !!

 

Related Article

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.