IOS package Static Library. A file (True Machine Edition + virtual machine)

Source: Internet
Author: User

For example, we packaged the Highland Map Base Feature Pack Gdmap package in iOS development.

1> we need to get ready to pack the Gdmap

2> Next we start building a new project file named Gdmap



3> Delete the useless auto-generated. h and. m files, drag the prepared Gdmap into the project, and note that the files are placed in a first-level directory.

4> Next we choose to come up with a header file that needs to be exposed. h

I chose to expose all the header files as

5> Next we configure the project file, modify

Product->scheme-> Edit Scheme for Release

After the 6> configuration we can choose the real machine to run after running, then run the virtual machine once, we find the generated. A file right-click on the show in finder.

7> merges two. A files so that they can be used on both the simulator and the real machine

Lipo-create to close the two files 1 paths to fit two files 2 path-output .../desktop/gdmap.a (build path)

Attention:

Select the compiled device, theIOS device is compiled by the real machine, the selection simulator is compiled by the simulator version

If you use someone else's, don't know what way he was compiled. The terminal command line can be used to view


Lipo-info the path of the file to view (drag it directly over)

ARMV7 arm64 Real Machine

I386 simulator


When used:

Add a static library . A file to the project, add the . h file at the same time

Use this static library by viewing the. h file

A static library error appears as follows: The schema of the static library used is incorrect

Undefined Symbols for Architecture i386:

"_objc_class_$_staticlibrary", referenced from:

Objc-class-ref in VIEWCONTROLLER.O

Ld:symbol(s) not found for architecture i386

Clang:error:linker command failed with exit code 1 (use-v to see invocation)

Error :

Xcrun:error:active Developer Path ("/users/xjw/desktop/Xcodeapp/contents/developer") does not exist, use ' xcode-select--switch path/to/xcode.app ' to specify the Xcode-you-Wish-use-command line Develo Per tools (or see ' Mans Xcode-select ')

Workaround :

sudo xcode-select--switch/applications/xcode.app

IOS package Static Library. A file (True Machine Edition + virtual machine)

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.