Builds an iphoneos
(Device) and iphonesimulator
(Simulator) binary using xcodebuild
(comes with Xcode). The two binaries get merged afterwards using lipo
. It also copies eventually existing header files in the result directory.
- Do
git clone [email protected]:MattesGroeger/xcode-universal-binary.git
wherever you want to have the shell script reside. - Navigate to the repository
cd xcode-universal-binary
. - Grant executable rights:
chmod a+x universal_binary.sh
. - Add the
universal_binary.sh
to yourPATH
(e.g. in .bash_profile). - Navigate to the project you want to create a universal binary of.
- Call
universal_binary.sh {target} {lib.a}
where you have to replace{target}
with the Xcode target and{lib.a}
with the target library name.
This version only creates the Release
configurations.
Thanks to Eonil who did the basic work in this stackoverflow post.