framework 相关知识小汇总

0, 以下都以xxxxx.framework举例说明
1,swift兼容framework必须是dynamic类型的,否则会报错

查看包是静态还是动态,打开终端

// 1,进入到xxxxx.framework路劲(mac直接拖拽就行)
cd framework路径
//2, file 然后输入framework名称(不带后缀framework), 回车
file xxxxx

如果是动态的则显示以下样子,xxxxx为framework的名字

终端:
xxxxx: Mach-O universal binary with 3 architectures: [arm_v7:Mach-O dynamically linked shared library arm_v7] [x86_64] [arm64]
xxxxx (for architecture armv7): Mach-O dynamically linked shared library arm_v7
xxxxx (for architecture x86_64):    Mach-O 64-bit dynamically linked shared library x86_64
xxxxx (for architecture arm64): Mach-O 64-bit dynamically linked shared library arm64
2,arm64,arm_v7是真机,x86_64为模拟器

如果想单独使用一个,则remove即可

//查看当前支持架构:(同样还是在framework文件夹内)
lipo -info xxxxx
//返回如下:
终端:Architectures in the fat file: TankManual are: armv7 x86_64 arm64 
去除x86_64
lipo -remove x86_64 xxxxx -o xxxxx        
回车
lipo -info xxxxx
终端:Architectures in the fat file: TankManual are: armv7 arm64 
最后的framework则为真机的framework

你可能感兴趣的:(framework 相关知识小汇总)