Search code examples
xcodemacosbattery

Preserving battery life when using Xcode - your settings/recommendations?


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?


Solution

  • 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.