Removing unused frameworks in Xcode?

主宰稳场 提交于 2019-11-29 17:19:46

问题


Over time when you develop an application you add new libraries to it, new frameworks needed for the libraries to work. Then you remove libraries and if you are like me you have forgotten to remove the frameworks that you initially added.

Is there a way to find out what frameworks are needed for my code to function?


回答1:


I just delete the questionable frameworks from the link phase in Xcode (or the xcconfig, if you define them there) and reintroduce the frameworks based on ld's errors.

If you are targeting multiple OS versions, it may be a good idea to also build and link against those SDKs since things can move around a bit.

I also do not typically link static libraries to their dependencies, reserving that for the final executable.

Once that phase is complete, you can remove the frameworks you do not link from your Xcode project.




回答2:


I hate to grave dig, but I had found that you can easily test dependency by unchecking it from your target in Inspector and building. If there are no errors, there is no dependency.



来源:https://stackoverflow.com/questions/7847558/removing-unused-frameworks-in-xcode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!