https://blog.csdn.net/LisztCoder/article/details/78132147
Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: HTTPS: //blog.csdn.net/LisztCoder/article/details/78132147
iOS's advanced research and development group: 98,787,555
Maker: Xcode7.2.1
here is the image. I am white. Great God comments please leave a message! Do not neglect the novice. So this article will be written in great detail! No one should bother to create a dynamic library or use a real machine simulator use it. Therefore, this article created directly versatile!
The first step in creating a dynamic library project
Next, create a dynamic library project name
The third step is to create a common DLL File> New> Target> Aggretate
The fourth step, select MyAggetate
The fifth step, create a script
The sixth step, the preparation of general-purpose scripting
Specific code as follows:
[objc] 查看纯文本
#设置目标文件夹和最终的框架产品。
#如果工程名称和Framework的目标名称不一样的话,要自定义FMKNAME
#例如:FMK_NAME =“MyFramework”
FMK_NAME = $ {} PROJECT_NAME
#安装目录将是框架的最终输出。
#以下行在当前项目的根文件夹中创建它。
INSTALL_DIR = $ {SRCROOT} / Products / $ {FMK_NAME} .framework
#工作目录将在框架创建后被删除。
WRK_DIR =构建
DEVICE_DIR = $ {} WRK_DIR /释放-的iPhoneOS / $ {} FMK_NAME .framework
SIMULATOR_DIR = $ {} WRK_DIR /释放-iphonesimulator / $ {} FMK_NAME .framework
#-configuration $ {CONFIGURATION}
清理和构建两种体系结构。
xcodebuild -configuration “Release” -target “$ {FMK_NAME}”- sdk iphoneos clean build
xcodebuild -configuration “Release” -target “$ {FMK_NAME}”- sdk iphonesimulator clean build
# Cleaning oldest
if [-d "$ {INSTALL_DIR}" ]
Then
rm -rf "$ {INSTALL_DIR}"
Science Fiction
mkdir -p "$ {INSTALL_DIR}"
CP -R & lt "$ {DEVICE_DIR} /" "$ {INSTALL_DIR } / "
# use Lipo tool binaries (i386 + armv6 / armv7) merge into a common final product.
lipo -create "$ {DEVICE_DIR} / $ {FMK_NAME}" "$ {SIMULATOR_DIR} / $ {FMK_NAME}" - Output "$ {INSTALL_DIR} / {$} FMK_NAME"
RM -R & lt "$ {} WRK_DIR"
open "$ {INSTALL_DIR} "
The seventh step, switch to run MyAggetate
If nothing abnormal will automatically pop up the corresponding folder dynamic report
Up to this point, creating a dynamic library is complete. The next step is commissioning
The eighth step, add a dynamic library
Now after the import to run. Because I left a contact so it will not do too much explanation. For questions, please add QQ group asked the top!
----------------
Disclaimer: This article is the original article CSDN bloggers "LisztCoder", and follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement. .
Original link: https: //blog.csdn.net/LisztCoder/article/details/78132147