删除Xcode中未使用的框架? [英] Removing unused frameworks in Xcode?

查看:85
本文介绍了删除Xcode中未使用的框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

随着时间的流逝,在开发应用程序时,您会向其中添加新的库,这些库需要新的框架才能正常工作.然后,您删除了库,如果您像我一样,也忘记了删除最初添加的框架.

是否有办法找出我的代码运行所需的框架?

解决方案

我只是从Xcode(或xcconfig,如果在其中定义它们)的链接阶段删除有问题的框架,然后根据ld的错误重新引入这些框架. /p>

如果您针对多个操作系统版本,则最好构建并链接这些SDK,因为事情可能会有所变动.

我通常也不会将静态库链接到它们的依赖项,而是将其保留给最终的可执行文件.

该阶段完成后,您可以从Xcode项目中删除未链接的框架.

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?

解决方案

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.

这篇关于删除Xcode中未使用的框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆