Providing the XCODE Project as a Library

How can I free the library for my XCODE project? I have a project that I would like to provide to others as a library.

+3
source share
1 answer

You have to make Cocoa Touch Static Library . This contains all the header and implementation files that you want to send, and then use the script as shown below:

#!/bin/bash
#build the device
echo building for ARM architecture
xcodebuild -sdk iphoneos4.2 "ARCHS=armv6 armv7" build > /dev/null
#build the simulator
echo building for the i386 architecture
xcodebuild -sdk iphonesimulator4.2 "ARCHS=i386 x86_64" "VALID_ARCHS=i386 x86_64" build > /dev/null
#make the folder
mkdir "Fat Binary"
#lipo suck it together
echo lipo binaries together
lipo -output Fat\ Binary/libMyLib.a -create build/Release-iphoneos/libmyLib.a build/Release-iphonesimulator/libmyLib.a
echo lipo binary saved at $./Fat Binary/libmyLib.a
echo coping headers
cp -R build/Release-iphoneos/usr "Fat Binary"
echo [COMPLETE]

This, in a nutshell, creates a folder containing the library (libmyLib.a) and a headers folder (usr) to be added to the target project, the headers Add-> Existing Files and Library by Add-> Existing framework-> Add another.

, , , libmyLib.a .

, , , iOS , .

+5

Source: https://habr.com/ru/post/1796163/


All Articles