# Sets the target folders and the final framework product.
# Set destination folder and dynamic library
Fmk_name=${project_name}
# Install Dir'll is the final output to the framework.
# The following line create it at the root folder of the current project.
# install_dir=${srcroot}/products/${fmk_name}.framework--- original path
# Specify the final generated dynamic library path
install_dir=${srcroot}/products/${fmk_name}.framework--- Original Path
# working dir would be a deleted after the framework creation.
# The path of the Dynamic Library original real machine and the emulator package
Wrk_dir=build
Device_dir=${wrk_dir}/release-iphoneos/${fmk_name}.framework
Simulator_dir=${wrk_dir}/release-iphonesimulator/${fmk_name}.framework
#-configuration ${configuration}
# Clean and Building both architectures.
# compile real machine and emulator dynamic library
Xcodebuild-configuration "Release" -target "${fmk_name}" -sdk iphoneos Clean build
Xcodebuild-configuration "Release" -target "${fmk_name}" -sdk iphonesimulator Clean build
# cleaning the oldest.
If [-D "${install_dir}" ]
Then
RM-RF "${install_dir}"
Fi
Mkdir-p "${install_dir}"
Cp-r "${device_dir}/" " ${install_dir}/"
# Uses The Lipo Tool to merge both binary files (i386 + armv6/armv7) into one Universal final product.
# Crafting Package
Lipo-create "${device_dir}/${fmk_name}" " ${simulator_dir}/${fmk_name}" -output "${install _dir}/${fmk_name} "
Rm-r "${wrk_dir}"
iOS Dynamic Library compositing package (real machine & emulator) script