iOS. A and. Framework

Source: Internet
Author: User

Create aggregate to merge the simulator with the generic framework of the real machine

Then create the merge script under build phases new Run script phase:

# Constantssf_target_name=${project_name} #自定义的用来存放最后合并的frameworkUNIVERSAL_OUTPUTFOLDER=${build_dir}/${configuration}-Universal#iphone_device_build_dir=${build_dir}/${configuration}-Iphoneosworkspace_name=${project_name}.xcworkspaceyo_scheme=${project_name} #clean build is the first to clear the original Buildxcodebuild-workspace ${workspace_name}-scheme ${yo_scheme}-sdk iphonesimulator-configuration"${configuration}"Clean buildxcodebuild-workspace ${workspace_name}-scheme ${yo_scheme}-sdk iphoneos-configuration"${configuration}"Clean build# Build Project#xcodebuild-project"${project_file_path}"-target"${target_name}"-configuration"${configuration}"-SDK Iphoneos build_dir="${build_dir}"objroot="${objroot}"build_root="${build_root}"Configuration_build_dir="${iphone_device_build_dir}/arm64"symroot="${symroot}"archs='arm64'valid_archs='arm64'$ACTION #xcodebuild-project"${project_file_path}"-target"${target_name}"-configuration"${configuration}"-SDK Iphoneos build_dir="${build_dir}"objroot="${objroot}"build_root="${build_root}"Configuration_build_dir="${iphone_device_build_dir}/armv7"symroot="${symroot}"archs='armv7 armv7s'valid_archs='armv7 armv7s'$ACTION # Copy of the framework structure to the Universal folder (clean it first) #因为framework的合并, Lipo just merged the final binary executable file, We're going to have to copy it by ourselves. # Remove the original RM-rf"${universal_outputfolder}"mkdir-P"${universal_outputfolder}"CP-R"${build_dir}/${configuration}-iphonesimulator/${project_name}.framework" "${universal_outputfolder}/${project_name}.framework"#合并模拟器和真机的架构lipo-create"${build_dir}/${configuration}-iphonesimulator/${project_name}.framework/${project_name}""${build_dir}/${configuration}-iphoneos/${project_name}.framework/${project_name}"-output"${universal_outputfolder}/${project_name}.framework/${project_name}"Open"${universal_outputfolder}"

For the above script, which uses a lot of Xcode predefined variables, how do these variables come from? You can enter it at the command line

Xcodebuild-workspace yohunlutilslib.xcworkspace-scheme yohunlutilslib-sdk iphonesimulator-configuration Debug- Showbuildsettings > Xcodebuild_showbuildsettings.txt

To import all of the Xcode pre-defined variables into the text xcodebuild_showbuildsettings.txt, and then you can choose what you want.

Of course, we should generally merge the release mode, not the framework of the debug mode

View information about the. Framework:

Lipo-info AA.FRAMEWORK/AA

Show:

Architectures in the Fat File:aa.framework/aa are:armv7 arm64

Shows that the real machine framework:aa.framework we generated contains two architectures armv7 arm64

Separation architecture (as an example of separating armv7)

The current directory establishes a folder for separating the schemas, and the isolated. o Files

mkdir armV7

Detach the ARMV7 schema into the folder armV7:

Lipo Aa.framework/aa-thin Armv7-output./armv7/aa_armv7

Detach all. o files from the ARMV7 schema

-X AA_ARMV7

iOS. A and. Framework

Related Article

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.