Xcode 9 - 高 CPU 使用率 - 风扇最大速度

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/46633160/
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 10:21:00  来源:igfitidea点击:

Xcode 9 - High CPU usage - Fan max speed

xcodeperformancecpuxcode9

提问by Edouard Barbier

Ever since I upgraded to Xcode 9, my fan goes crazy when I'm working on Xcode. This is especially happening when I use Storyboards and Interface Builder.

自从我升级到 Xcode 9 后,当我在 Xcode 上工作时,我的粉丝就疯了。当我使用 Storyboards 和 Interface Builder 时尤其会发生这种情况。

Xcode sometimes takes up to 100% of the CPU and the process named "Interface Builder Cocoa Touch Tool" is also very greedy.

Xcode 有时会占用高达 100% 的 CPU,名为“Interface Builder Cocoa Touch Tool”的进程也非常贪婪。

I read here and there that other people have had similar issues but I was wondering if anyone found a solution to this considering it's most likely a Xcode bug.

我在这里和那里读到其他人也有类似的问题,但我想知道是否有人找到了解决方案,因为它很可能是 Xcode 错误。

Things I've tried:

我尝试过的事情:

  • Unplugging my second screen: no effect
  • Rebooting Xcode: no effect
  • Rebooting Mac: no effect
  • Cleaning Derived Data folder: no effect
  • Cleaning project: no effect
  • Opening only 1x project at the time (annoying): a bit better but still not great
  • 拔掉我的第二个屏幕:没有效果
  • 重新启动 Xcode:没有效果
  • 重新启动 Mac:没有效果
  • 清理派生数据文件夹:无效
  • 清洗项目:无效果
  • 当时只打开 1x 项目(烦人):好一点但仍然不是很好

Did anyone find a solution to this issue?

有没有人找到解决这个问题的方法?

Mac Config:

Mac 配置:

  • MacBook Pro (Retina, 15-inch, Mid 2014)
  • Processor: 2,5 GHz Intel Core i7
  • Memory: 16 GB 1600 MHz DDR3
  • Graphics: NVIDIA GeForce GT 750M 2048 MB Intel Iris Pro 1536 MB
  • MacBook Pro(视网膜显示屏,15 英寸,2014 年中)
  • 处理器:2,5 GHz Intel Core i7
  • 内存:16 GB 1600 MHz DDR3
  • 显卡:NVIDIA GeForce GT 750M 2048 MB Intel Iris Pro 1536 MB

Xcode version:9.0 (9A235)

Xcode 版本:9.0 (9A235)

回答by Tamás Zahola

Open your xibs/storyboards and turn off “Editor / Automatically refresh views”.

打开您的 xibs/故事板并关闭“编辑器/自动刷新视图”。

The issue is caused by Xcode continually rebuilding your project to update things like custom IB_DESIGNABLEviews.

该问题是由 Xcode 不断重建您的项目以更新诸如自定义IB_DESIGNABLE视图之类的内容引起的。

Trigger it manuallyvia Editor > Refresh All views

通过手动触发它Editor > Refresh All views