关键点,先记下,以后再补充
1、配置
1、run -> debug
模式换成release
2、默认创建的framework 是动态库,在 build setting
设置Mach-O type = StaticLibrary

3、输入 在build setting
设置 Build Active Architecture Only = NO
代表 当前输出的是 支持所有设备,YES
是当前选择的设备。
2、调试
1创建demo
工程,然后 在 file > save as workspace
关闭项目,打开 .workspace
,然后把framework
工程拷贝到同目录,在工程中拖入framework的.project
文件, 在run
的里面可以选择 framework或者demo工程,直接修改framework之后 command+b
,切换到demo 运行即可,调试

3、输出
lipo -info 查看framework支持的架构集
lipo -create 真机路径 模拟器路径 -output 真机路径
在xcode12之前,上面的操作,完全可以输入合并的。
1、问题
问题一:
xcode12上出现的
have the same architectures (arm64) and can't be in the same fat output file
我自己的做法是,在模拟器command+b
的时候 修改配置项:
build settings->excluded architectures 加入arm64架构,
这是把arm64 排除在外,这样到处的framework 用lipo -info 查询是不包含arm64
导出真机的时候,删除加入的arm64
执行command+b
,
这样再去合并。就能解决这个问题了。
问题二:
貌似是swift版本的才有这个问题
Could not find module for target 'x86_64-apple-ios-simulator'; found: arm64, armv7-apple-ios, arm64-apple-ios, arm, armv7
在模拟器和真机合并framework之后,还会出现这个问题,就需要把framework
中Modules
的文件拷贝到合并的framework
中:

如图,-output
路径为Realse-iphoneos
,所以把Realse-iphonesimulator->Modules
中的红色标注,拷贝到Realse-iphoneos
对应位置。
解决问题。
网友评论