framework in ios contain static or dynamic library inside

后端 未结 2 634
我寻月下人不归
我寻月下人不归 2021-01-13 04:34

I have come across multiple sites describing that frameworks can contain both static as well as dynamic library. But how do I identify if what the framework actually contain

2条回答
  •  梦毁少年i
    2021-01-13 04:43

    It is simple to determine when a file extension is explicit

    • .a - static library
    • .dylib - dynamic library

    you can use file command

    file /some_path/.framework/
    
    //possible results
    current ar archive random library //static library
    dynamically linked shared library //dynamic library
    

    *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

    [Vocabulary]
    [Static vs dynamic framework]

提交回复
热议问题