如何清空缓存并清理所有目标Xcode 4及更高版本 [英] How to Empty Caches and Clean All Targets Xcode 4 and later

查看:313
本文介绍了如何清空缓存并清理所有目标Xcode 4及更高版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Jonathan在此处建议: Xcode包含.xib文件
清除所有目标并清空缓存将解决Xcode包括已删除的.xib文件的问题,但是我找不到在Xcode 4中清空缓存的方法。

Jonathan suggest here: Xcode Includes .xib files that have been deleted! that cleaning all targets and empty the caches will fix the problem with Xcode including deleted .xib files but I cannot find a way to empty the cache in Xcode 4.

如何在Xcode 4中做到这一点?

How to do that in Xcode 4?

推荐答案

Command-Option-Shift-K清除构建文件夹。更好的是,退出Xcode并手动清除〜/ Library / Developer / Xcode / DerivedData 。删除所有内容 ,因为存在一个错误,即Xcode会在某个地方运行项目的旧版本。 (Xcode 4.2将向您显示派生数据文件夹:选择窗口>管理器并切换到项目选项卡。单击派生数据文件夹名称右侧的右箭头。)

Command-Option-Shift-K to clean out the build folder. Even better, quit Xcode and clean out ~/Library/Developer/Xcode/DerivedData manually. Remove all its contents because there's a bug where Xcode will run an old version of your project that's in there somewhere. (Xcode 4.2 will show you the Derived Data folder: choose Window > Organizer and switch to the Projects tab. Click the right-arrow to the right of the Derived Data folder name.)

在模拟器中,选择 iOS模拟器>重置内容和设置。

In the simulator, choose iOS Simulator > Reset Content and Settings.

最后,出于完整性考虑,您可以删除 / var / folders ;

Finally, for completeness, you can delete the contents of /var/folders; some caching happens there too.

警告:删除 / var / folders 可能会引起问题,您可能需要修复或重新安装操作系统。这样做之后。

WARNING: Deleting /var/folders can cause issues, and you may need to repair or reinstall your operating system after doing so.

编辑:我刚刚了解到,如果您不愿意使用 / var / folders / ,可以使用以下命令终端中的命令以更有针对性的方式删除:

I have just learned that if you are afraid to grapple with /var/folders/ you can use the following command in the Terminal to delete in a more targeted way:

rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"

编辑:对于某些与Swift相关的问题,我发现删除〜/ Library / Caches / com.apple.dt.Xcode 。当您这样做时,您会损失很多,例如下载的文档文档集的备用副本,但这是值得的。

For certain Swift-related problems I have found it useful to delete ~/Library/Caches/com.apple.dt.Xcode. You lose a lot when you do this, like your spare copies of the downloaded documentation doc sets, but it can be worth it.

这篇关于如何清空缓存并清理所有目标Xcode 4及更高版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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