iOS 打包32bit&64 universal-framework
2015-06-23 18:51
716 查看
在原来的基础上添加新的framework target (32bit)
duplicate 64bit framework, 然后做相应改动,依赖于32bit target
build above target
otools -L xxx64.framework/xxx64 查看installname, use install_name_tool -id @rpath/xxx.framework/xxx xxx64.framework/xxx64
修改install name
create aggregate target, add run script to combine 32&64 target(use lip tools)
lipo -create xxx32.framework/xxx32 xxx64.framework/xxx64 xxx,
cp xxx.framework newpath/xxx.framework
replace newpath/xxx.framework/xxx with combined target
ps: 这步也可以使用手工lipo生成
在demo project中使用:general->embeded binaries
add import <xxx.framework/xxx.h>
ps:
The important thing to realize is that the install path is built into the dylib, as part of its build process.
trouble shooting:
deep clean & relaunch Xcode !
一篇很有用的参考博客
https://medium.com/@syshen/create-an-ios-universal-framework-148eb130a46c
duplicate 64bit framework, 然后做相应改动,依赖于32bit target
build above target
otools -L xxx64.framework/xxx64 查看installname, use install_name_tool -id @rpath/xxx.framework/xxx xxx64.framework/xxx64
修改install name
create aggregate target, add run script to combine 32&64 target(use lip tools)
lipo -create xxx32.framework/xxx32 xxx64.framework/xxx64 xxx,
cp xxx.framework newpath/xxx.framework
replace newpath/xxx.framework/xxx with combined target
ps: 这步也可以使用手工lipo生成
在demo project中使用:general->embeded binaries
add import <xxx.framework/xxx.h>
Xcode Script to Lipo Tool
# Sets the target folders and the final framework product. FMK_NAME="FI" FMK_VERSION="A" # 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 # Building both architectures. xcodebuild -configuration "Release" -target "${FMK_NAME}" -sdk iphoneos xcodebuild -configuration "Release" -target "${FMK_NAME}" -sdk iphonesimulator # Cleaning the oldest. if [ -d "${INSTALL_DIR}" ] then rm -rf "${INSTALL_DIR}" fi # Creates and renews the final product folder. mkdir -p "${INSTALL_DIR}" mkdir -p "${INSTALL_DIR}/Versions" mkdir -p "${INSTALL_DIR}/Versions/${FMK_VERSION}" mkdir -p "${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources" mkdir -p "${INSTALL_DIR}/Versions/${FMK_VERSION}/Headers" # Creates the internal links. # It MUST uses relative path, otherwise will not work when the folder is copied/moved. ln -s "${FMK_VERSION}" "${INSTALL_DIR}/Versions/Current" ln -s "Versions/Current/Headers" "${INSTALL_DIR}/Headers" ln -s "Versions/Current/Resources" "${INSTALL_DIR}/Resources" ln -s "Versions/Current/${FMK_NAME}" "${INSTALL_DIR}/${FMK_NAME}" # Copies the headers and resources files to the final product folder. cp -R "${DEVICE_DIR}/Headers/" "${INSTALL_DIR}/Versions/${FMK_VERSION}/Headers/" cp -R "${DEVICE_DIR}/" "${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources/" # Removes the binary and header from the resources folder. rm -r "${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources/Headers" "${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources/${FMK_NAME}" # 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}/Versions/${FMK_VERSION}/${FMK_NAME}" rm -r "${WRK_DIR}"
ps:
The important thing to realize is that the install path is built into the dylib, as part of its build process.
trouble shooting:
deep clean & relaunch Xcode !
一篇很有用的参考博客
https://medium.com/@syshen/create-an-ios-universal-framework-148eb130a46c
相关文章推荐
- IOS学习之NSTimer使用详解
- iOS文字大小自适应库(MBFontAdapter)诞生记
- IOS学习之定时器NSTimer的开启与关闭
- iOS AES解密 我遇到的问题
- iOS 目录的使用
- IOS8下,百度地图无法定位解决办法
- IOS开发 根据某个日期计算是星期几
- iOS之JSONKit解析JSON
- iOS开发ARC下内存管理
- iOS之NSJSONSerialization对json解析
- ios view截图
- iOS view模糊背景
- iOS CAGradientLayer 颜色渐变
- 消消乐无限道具BUG
- ios修改textField的placeholder的字体颜色、大小
- iOS 8 毛玻璃效果
- iOS TableView实现QQ好友列表(三)
- 支付宝 iOS SDK 官方下载页面
- iOS开发-编译出错 duplicate symbols for architecture x86_64
- IOS开发——获取本地音频文件(属性/信息)