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

查看:22
本文介绍了如何清空缓存并清理所有目标 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 Simulator > Reset Content and Settings.

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天全站免登陆