Xcode 6 making dynamic and static framework

Source: Internet
Author: User

Xcode 6 making dynamic and static Frameworkios static libraries

Key points

    1. The new target is set to cocoa Touch framework,deployment Target (minimum supported version of the system) to 5.1.1.

    2. 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}"
  1. Set as Static library

  2. Add frame support 5c, add armv7s to architectures

  3. Determine which schemas a framework supports, using the lipo-inof frameworkpath command

  4. 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

  5. Target's settings are for each target, and project's settings are for all target.

  6. You need to import the PCH file before using it

    1. Import files that need to be compiled, and use the Ignore partial file without arc

    1. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.