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)