Xcode 运行非常缓慢

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/41166963/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 09:39:09  来源:igfitidea点击:

Xcode is running really slow

iosxcodemacosperformance

提问by Richard Wessels

I've recently tried to use Xcode 8 to make iOS apps and to test things in Swift however it is impossible to work on as doing a simple 'print("Hello World")' takes easily over a minute to process to print it to the console, I tried doing regular development as well by creating UI buttons etc. but when I try to compile it, it is too slow to work and that is with simple things. My computer is the Mid 2012 Macbook Pro Non-retina with 4GB of RAM, not a quick computer but I can program in Python without these problems. If anyone knows some solutions please tell me! Thanks.

我最近尝试使用 Xcode 8 来制作 iOS 应用程序并在 Swift 中测试东西,但是这是不可能的,因为做一个简单的“打印(“Hello World”)”需要一分钟多的时间来处理打印到控制台,我也尝试通过创建 UI 按钮等来进行常规开发,但是当我尝试编译它时,它的工作速度太慢了,这就是简单的事情。我的电脑是 2012 年中期的 Macbook Pro Non-retina,有 4GB 的 RAM,不是一台快速的电脑,但我可以用 Python 编程而不会出现这些问题。如果有人知道一些解决方案,请告诉我!谢谢。

回答by Mike

When you build a project for the first timedo it normally (it will take a while like you described)

当您第一次构建项目时,请正常进行(像您描述的那样需要一段时间)

After the first build Go to Product -> Scheme -> Edit Scheme. Select Buildin left side column and uncheck Find implicit dependencies.

第一次构建后转到Product -> Scheme -> Edit Scheme。选择Buildin left side column 并取消选中Find hidden dependencies

This appears to be a well known problem: https://forums.developer.apple.com/thread/62737

这似乎是一个众所周知的问题:https: //forums.developer.apple.com/thread/62737

"If there's not enough context to decide, the compiler has to go with the conservative choice and record it as cascading."

“如果没有足够的上下文来决定,编译器必须采用保守的选择并将其记录为级联。”