使用 Xcode 时保持电池寿命 - 您的设置/建议?

发布于 2024-07-17 03:56:15 字数 108 浏览 6 评论 0原文

我经常发现自己想在国际航班上以及断电时打开 Xcode 进行一些编码,但这是一种快速耗尽 MacBook Pro 电池的方法。

在运行 Xcode 时,您使用什么设置来延长电池寿命?

I often find myself wanting to open Xcode and do a little coding on international flights and while I'm away from power, but it's a quick way to empty my MacBook Pro's battery.

What settings do you use to preserve battery life while running Xcode?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

陪你到最终 2024-07-24 03:56:16

当使用电池运行时,预测编译会自动禁用。

如果您有一台双核机器,

defaults write com.apple.Xcode XCMaxNumberOfDistributedTasks 1 

一次编译一个文件(而不是在双核 CPU 的每个核心上编译一个文件),这可能会节省一些费用。

Predictive compilation automatically disables itself when running on battery.

If you have a dual-core machine,

defaults write com.apple.Xcode XCMaxNumberOfDistributedTasks 1 

compiles one file at a time (instead of one on each core of your dual-core CPU) which may result in some savings.

别在捏我脸啦 2024-07-24 03:56:16

我的猜测是,XCode 的预测编译(在您键入时进行编译,以缩短以后的构建时间)将是一个很大的吸引力,就像索引一样。 您可以在“首选项”中的“构建”和“代码感知”下分别将它们关闭。

不过,一些简单的测试似乎表明,如果您使用电池,它不会进行预测编译。 所以,也许这不是问题。 如果你能忍受它的关闭,索引仍然可能有帮助。

它可能还有助于在编译时做尽可能少的工作 - 也许检查以确保您在导入的所有大型框架中使用预编译头。

My guess would be that XCode's predictive compilation (which compiles as you type to shorten build times later on) would be a big draw, as well as indexing. You can turn them both off in Preferences, under "Building" and "Code Sense," respectively.

Some light testing, though, seems to show that it doesn't do predictive compilation if you're on battery. So, maybe that's not a problem. Indexing still might help, if you can stand it being off.

It would probably also help to do as little work as possible while compiling - maybe check to make sure you're using precompiled headers with all the large frameworks you're importing.

抹茶夏天i‖ 2024-07-24 03:56:16

我发现节省 Mac 电池电量的最佳方法是使用通用访问反转所有颜色。 一切看起来都是负面的,但如果你能容忍这一点,你的屏幕将大部分是黑色的,我相当相信它会有所作为。

除此之外,检查是否可以关闭其中一个核心,我经常在我的 mac pro 上这样做。

注意:我很清楚,在液晶显示器中,白色和黑色像素之间的功率差异非常小。 然而,根据我自己有限的经验,在黑色背景下工作时,我可以比在白色背景下工作时降低对比度和亮度,并且这确实可以节省电量。

I found that the best way to save battery on my mac is to reverse all the colors using universal access. Everything looks in negative, but if you can tolerate that, your screen would be mostly black and I am fairly convinced that it makes a difference.

Other than that, check if you can shut down one of the cores, I do that often on my mac pro.

Note: I am well aware that in LCDs, there is very little power difference between white and black pixels. However, in my own limited experience, I can reduce contrast and brightness when working against a black background than I can against a white background, and that does produce a power saving.

断念 2024-07-24 03:56:16

如何更改编辑窗口以在深色背景上显示浅色文本。

首选项中的字体和颜色下有预定义的设置。

How about changing the editing window to have light text on a dark background.

There are predefined settings in the preferences under fonts and colours.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文