本篇承接上一篇文章:iOS 静态库与动态库的区别
命令行进入动态库文件,使用file命令查看输出内容可以看到区别。以静态库文件-MAMapKit.framework与动态库文件-AFNetworking.framework为例。
1. 静态库文件-MAMapKit.framework
cd /Users/***/Desktop/Framework/MAMapKit.framework
file MAMapKit
输出
MAMapKit: Mach-O universal binary with 4 architectures: [arm_v7:current ar archive random library] [arm64]
MAMapKit (for architecture armv7): current ar archive random library
MAMapKit (for architecture i386): current ar archive random library
MAMapKit (for architecture x86_64): current ar archive random library
MAMapKit (for architecture arm64): current ar archive random library
archive表明这是一个静态库
2. 动态库文件-AFNetworking.framework
cd /Users/***/Desktop/Framework/AFNetworking.framework
file AFNetworking
输出
AFNetworking: Mach-O universal binary with 2 architectures: [arm_v7:Mach-O dynamically linked shared library arm_v7] [arm64:Mach-O 64-bit dynamically linked shared library arm64]
AFNetworking (for architecture armv7): Mach-O dynamically linked shared library arm_v7
AFNetworking (for architecture arm64): Mach-O 64-bit dynamically linked shared library arm64
dynamically linked shared library表明这是一个动态库