如何阻止 Xcode 9 持续构建或至少使其不运行构建脚本?

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

How do I stop Xcode 9 from continuously building or at least make it not run build scripts?

xcodexcode9

提问by Roman Temchenko

After migrating to Xcode 9, I noticed that it constantly fully builds my project. I found that it is somehow related to the "show live issues" setting. Disabling that setting stops builds, but it makes development inconvenient.

迁移到 Xcode 9 后,我注意到它不断地完全构建我的项目。我发现它与“显示实时问题”设置有某种关系。禁用该设置会停止构建,但会给开发带来不便。

I would like to disable this continuous build loop, or make it work without launching all build scripts.

我想禁用这个连续的构建循环,或者让它在不启动所有构建脚本的情况下工作。

My custom build scripts contain linting and formatting, so what happens is, I try to edit a file, but Xcode starts building, thus launching the formatting routine that changes exactly the same file I am trying to edit.

我的自定义构建脚本包含 linting 和格式化,所以发生的情况是,我尝试编辑一个文件,但 Xcode 开始构建,从而启动更改与我试图编辑的文件完全相同的文件的格式化例程。

回答by Ohmy

Open any .storyboard file in your project and go to the Editor menu, uncheck 'Automatically Refresh Views'.

打开项目中的任何 .storyboard 文件并转到编辑器菜单,取消选中“自动刷新视图”。

enter image description here

在此处输入图片说明

回答by vibhanshu

After upgrading the Xcode version to Xcode 9.0, I also faced a similar issue and my CPU usage was jumping upto 50% just because of Xcode. However I could solve it by following the steps below.

将 Xcode 版本升级到 Xcode 9.0 后,我也遇到了类似的问题,仅仅因为 Xcode,我的 CPU 使用率就飙升至 50%。但是我可以按照以下步骤解决它。

In the Toolbar go to: File-> Project Settings/ Workspace settingschange Build Systemto Standard Build Settingsunder Shared Workspace Settings. Also under Per-User workspace Settingchange Build Systemto Standard Build System.

在工具栏中转到: File-> Project Settings/ Workspace settingsShared Workspace Settings下将Build System更改为Standard Build Settings。同样在Per-User 工作区设置下,Build System更改为Standard Build System

The release notes also say the following.

发行说明还说明了以下内容。

"Xcode 9 includes a new build system written from scratch in Swift. It is designed for higher reliability, and it catches project configuration problems that the standard build system does not. The performance of the build system (not including compilers, linkers, and other build tools) has been dramatically improved."

“Xcode 9 包含一个用 Swift 从头开始​​编写的新构建系统。它旨在提高可靠性,并捕获标准构建系统没有的项目配置问题。构建系统的性能(不包括编译器、链接器和其他构建工具)得到了显着改进。”

So there could be a possibility that there are still bugs in the new build system.

因此,新构建系统中可能仍然存在错误。