使用 Xcode 时保持电池寿命 - 您的设置/建议?
我经常发现自己想在国际航班上以及断电时打开 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
当使用电池运行时,预测编译会自动禁用。
如果您有一台双核机器,
一次编译一个文件(而不是在双核 CPU 的每个核心上编译一个文件),这可能会节省一些费用。
Predictive compilation automatically disables itself when running on battery.
If you have a dual-core machine,
compiles one file at a time (instead of one on each core of your dual-core CPU) which may result in some savings.
我的猜测是,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.
我发现节省 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.
如何更改编辑窗口以在深色背景上显示浅色文本。
首选项中的字体和颜色下有预定义的设置。
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.