Xcode 6 making dynamic and static Frameworkios static libraries
Key points
The new target is set to cocoa Touch framework,deployment Target (minimum supported version of the system) to 5.1.1.
Make a common dynamic library (can be used on both the real machine and the simulator)
# Sets the target folders and the final framework product.# If the project name and the framework's target name are different, customize the Fmkname# example: Fmk_name = "Myframework", Project nameFmk_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.# Store The directory, the root directory of products inInstall_dir=${srcroot}/products/${fmk_name}. framework# working dir would be a deleted after the framework creation.# Set up the class library file for the emulator and the storage directory for the class library for the real machineWrk_dir=builddevice_dir=${wrk_dir}/release-iphoneos/${fmk_name}. frameworksimulator_dir=${wrk_dir}/release-iphonesimulator/${fmk_name}. framework#-configuration ${configuration}# Clean and Building both architectures.Xcodebuild-configuration"Release"-target"${fmk_name}"-SDK Iphoneos Clean buildxcodebuild-configuration"Release"-target"${fmk_name}"-SDK Iphonesimulator Clean Build# Cleaning the oldest. Remove the old class library file, Fi is the If end tagif[- D "${install_dir}"] ThenRm-rf"${install_dir}"fiMkdir-p"${install_dir}"# What is this sentence for? The merge is just the Bmobsdk file, the rest of the files need to be copied in the past, the rest of the file is the same as the virtual machineCp-r"${device_dir}/" "${install_dir}/"# Uses The Lipo Tool to merge both binary files (i386 + armv6/armv7) into one Universal final product.Lipo-create"${device_dir}/${fmk_name}" "${simulator_dir}/${fmk_name}"-output"${install_dir}/${fmk_name}"Rm-r"${wrk_dir}"Open"${install_dir}"
Set as Static library
Add frame support 5c, add armv7s to architectures
Determine which schemas a framework supports, using the lipo-inof frameworkpath command
Dead Code stripping set to No
Strip Debug Symbol During Copy all set to No
Strip style set to Non-global Symbols
Generate Debug symbols set to No
Lipo-info./myframework.framework/myframework
Target's settings are for each target, and project's settings are for all target.
You need to import the PCH file before using it
Import files that need to be compiled, and use the Ignore partial file without arc
Set up header files that need to be exposed
Problems
1. If iOS missing submodule
a word warning appears, try placing the open header file in a header file with the same name as the project.
Reference
Original link
Detailed reference
Xcode 6 making dynamic and static framework