更新时间:2023-01-02 11:56:23
检查静态还是动态
确定文件扩展名何时显式很简单
It is simple to determine when a file extension is explicit
.a
- 静态库.dylib
- 动态库.a
- static library.dylib
- dynamic library变体 1:
你可以使用file
命令
you can use file
command
file /some_path/<framework_name>.framework/<framework_name>
//possible results
current ar archive random library //static library
dynamically linked shared library //dynamic library
*可以在构建设置中将其更改为 Mach-O 类型
[关于] 从 Static Library target
到 Dynamic library
结果会生成 .a
文件,file
命令显示动态链接的共享库
,但它将是静态库
*It is possible to change it in Build Settings a Mach-O type
[About] from Static Library target
to Dynamic library
as a result .a
file will be generated, file
command show you dynamically linked shared library
but it will be static library
变体 2:[otool 静态或动态]
*有同样的副作用