1、制作SDK
创建工程选Framework

2、设置工程的Build Settings的Build Active Architecture Only为NO

3、设置run为release

4、设置最低版本号与机型

5、设置Mach-O Type为Static Library(静态库)

6、模拟器真机各运行一遍,Products会生成对应的库,右击 -> Show in Finder 可以看到生成的对应库,查看库支持的机型可用命令:lipo -info framework路径
7、合并真机模拟器:lipo -create 真机路径 模拟器路径 -output 真机路径
8、bundle的生成:桌面上新建文件夹修改后缀为.bundle然后把图片放进去
9、上传到git上
创建一个SDK文件夹,把刚刚生成的framwork和bundle放入文件夹中,再上传到git

10、上传到cocopods上
先给刚刚上传git的SDK打个tag值,cd到SDK目录下:
git tag 1.0.0
git push --tags
这个tag要和之后创建的podspec版本要一直,以后升级SDK后都要修改
11、创建podspec
cd到SDK目录下:pod spec create FrameworkTest
spec填写可参考网上教程,同步到git上
12、发布到cocopods
pod trunk push ./FrameworkTest.podspec --skip-import-validation --allow-warnings
发布成功之后大概过个十分钟就可以安装了:pod ‘FrameworkTest’
网友评论