iOS简单创建一个Framework文件
2016-03-01 11:00
295 查看
1 先创建一个新的工程选择cocoa Touch Framework
、
2.创建完成后写好要打包的文件,在工程的Build Phases 的Headers 从Project拖到Public显示头文件
3.接下来创建一个新的文件,点击左上角创建一个新的文件,选择target,在other里选择addregate
4.之后还是在Build Phases,点左上角的➕创建一个new run script phase
5.在run script 的shell里添加括号类容不含括号( # Sets the target folders and the final framework product.
# 如果工程名称和Framework的Target名称不一样的话,要自定义FMKNAME
# 例如: FMK_NAME = "MyFramework"
# ${PROJECT_NAME}
FMK_NAME="framwork测试"
# Install dir will be the final output to the framework.
# The following line create it in the root folder of the current project.
INSTALL_DIR=${SRCROOT}/Products/${FMK_NAME}.framework
# 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 "${SRCROOT}/Products/"
open "${INSTALL_DIR}" )记得修改FM NAME,改成你的工程名字
6.最后一步选择aggregate运行工程,就完成了
、
2.创建完成后写好要打包的文件,在工程的Build Phases 的Headers 从Project拖到Public显示头文件
3.接下来创建一个新的文件,点击左上角创建一个新的文件,选择target,在other里选择addregate
4.之后还是在Build Phases,点左上角的➕创建一个new run script phase
5.在run script 的shell里添加括号类容不含括号( # Sets the target folders and the final framework product.
# 如果工程名称和Framework的Target名称不一样的话,要自定义FMKNAME
# 例如: FMK_NAME = "MyFramework"
# ${PROJECT_NAME}
FMK_NAME="framwork测试"
# Install dir will be the final output to the framework.
# The following line create it in the root folder of the current project.
INSTALL_DIR=${SRCROOT}/Products/${FMK_NAME}.framework
# 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 "${SRCROOT}/Products/"
open "${INSTALL_DIR}" )记得修改FM NAME,改成你的工程名字
6.最后一步选择aggregate运行工程,就完成了
相关文章推荐
- iOS开发系列--地图与定位
- iOS之button
- iOS中的正则表达式
- ios开发理解nil,Nil, NULL
- iOS开发系列--IOS程序开发概览
- iOS8TestFlight内部测试和iTuneConnect权限
- iOS开发日期处理
- iOS开发------runtime关联对象(动态添加属性)
- 《编写高质量iOS与OS X代码的52个有效方法》之第二章要点
- iOS开发 automaticallyAdjustsScrollViewInsets 属性设置
- 关于iOS证书提示:此证书签发者无效
- iOS开发推送--客户端 服务端
- ios推送证书
- iOS 在制作framework时候对aggregate的配置
- iOS开发中 色值 16进制相互转换 详细RGB值
- 仿陌陌的ios客户端+服务端源码
- 仿陌陌的ios客户端+服务端源码
- iOS tabBar去掉黑线
- IOS 开发 证书显示 此证书签发者无效 解决办法
- ios 粘贴功能