I don't known have you every try to build iOS universal framework with Jenkins or not. I've try to create a build script to create Universal framework package. It was very hard to find out how it work. After i don't know 1 week or 3 days i finally find out how xcodebuild
work and when we want's to run with iPhone device
not simulator we should remove our code.
So how to build iOS universal framework with shell script and work with Jenkins
.
Let do this guys 🏃
Note
: This script give you iOS universal framework Work with any iOS devices, exceptiPhone 5 simulator
. It works in iPhone 5 and iPhone 5s device.
Don't forget Start
.
Go to your project and from TARGETS
select your project and click on Build Settings
Tab and like this image click on (+)
button and in shown menu click on Add User-Defined Setting
:
So now add new variable in User-Defined section. like bottom image change variable name to JENKINS
and click on Arrow
in left side of variable and for Debug
mode Enter NO
value and for Release
mode enter YES
value :
So very thinks seems to be simple. Let go to see Script and Modify it.
We have some variables in Build-Script let see them and of corse should change them.
Project Name :
In this variable should enter your project name or your target name
TARGET_NAME="MY PROJECT NAME"
Configuration :
Determine your configuration
is Debug
or Release
:
CONFIGURATION="Release"
Universal framework path :
Determine you want to get universal framework was copy where :
UNIVERSAL_OUTPUTFOLDER="${BUILD_ROOT}/${CONFIGURATION}-universal"
Note
: Universal build automatic was copied to root project path with this code :cp -rf "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework" "${PROJECT_DIR}"
Link bottom image click on (+)
button and when menu was shown click on New Run Script Phase
.
So you see create new section Run Script
enter this code here :
$SRCROOT/build-script.sh
This code get shell file from you root project path
and run this code for debugging
mode if you want to run sample project with your framework project.
Now put build-script file beside of your project
and run this shell with Terminal
or Jenkins