Merge iOS Static library

Source: Internet
Author: User

merging Cordovalib libraries:

Lipo-create ' release-iphoneos/libcordova.a ' "release-iphonesimulator/libcordova.a"-output "LIBCORDOVA.A"

View:

Lipo-info LIBCORDOVA.A

Merging Cordova scripts:

Define Static library target name

Lib_name="Cordova"

# define output Folder environment variable

Universal_outputfolder=${build_dir}/${configuration}-universal

Device_dir=${build_dir}/${configuration}-iphoneos

Simulator_dir=${build_dir}/${configuration}-iphonesimulator

# Step 1. Build Device and Simulator versions

# Insert Such-arch i386 before Build_dir assign arch

Xcodebuild-target "${lib_name}" only_active_arch=no-configuration ${configuration}-sdk Iphoneos BUILD_DIR=< c3> "${build_dir}" build_root="${build_root}"

Xcodebuild-target "${lib_name}" -configuration ${configuration}-sdk iphonesimulator BUILD_DIR="${BUILD_ DIR} " build_root=" ${build_root} "

# cleaning the oldest and make sure the output directory exists

If [-D "${universal_outputfolder}" ]

Then

RM-RF "${universal_outputfolder}"

Fi

Mkdir-p "${universal_outputfolder}"

# Step 2. Create Universal binary file using Lipo

Lipo-create " ${device_dir}/lib${lib_name}.a" "${simulator_dir}/lib${lib_name}.a" -output " ${universal_outputfolder}/lib${lib_name}.a "

# Last touch. Copy the header files. Just for convenience

Cp-r "${device_dir}/include" " ${universal_outputfolder}/"

?

#open the Universal dir

Open "${universal_outputfolder}/"

#delete DEVICE and SIMULATOR build file

#rm-rf "${device_dir}"

#rm-rf "${simulator_dir}"

Merge iOS Static library

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.