自動化製做.framework

 

1.生成.framework前的配置工做詳見:http://www.cnblogs.com/huangzs/p/8029258.htmlhtml

2.xcode

 

 

將如下腳本粘貼進去,修改FMK_NAME。iphone

# Sets the target folders and the final framework product.ui

 

# 若是工程名稱和FrameworkTarget名稱不同的話,要自定義FMKNAMEspa

 

# 例如: FMK_NAME = "MyFramework"3d

 

FMK_NAME="FRSDK"code

 

# Install dir will be the final output to the framework.htm

 

# The following line create it in the root folder of the current project.blog

 

INSTALL_DIR=${SRCROOT}/FRSDKAuto/${FMK_NAME}.frameworkip

 

# Working dir will be deleted after the framework creation.

 

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.

 

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.

 

lipo -create "${DEVICE_DIR}/${FMK_NAME}" "${SIMULATOR_DIR}/${FMK_NAME}" -output "${INSTALL_DIR}/${FMK_NAME}"

 

rm -r "${WRK_DIR}"

open "${INSTALL_DIR}"

 

 

而後選中如下箭頭所指向的地方,build便可。生成的.framework就在上面INSTALL_DIR= 配置的地方。

 

相關文章
相關標籤/搜索