How Your Mac Applications Make Use of App Nap to Save Energy

Taking a Nap Isn't Always the Best Use of Your Mac's Time

iMovie with App Nap option displayed
Screen shot courtesy of Coyote Moon, Inc.

Ever since OS X Mavericks, some of your Mac applications have been taking naps when you're not watching. Apple introduced the App Nap feature to allow for longer battery life in MacBooks, and better power efficiency in desktop Macs.

How App Nap Works

App Nap works by suspending an app when OS X determines it isn't performing any useful task. The OS performs this magic by watching to see if any app that has open windows on your desktop is completely hidden by other active apps.

If an app is hidden behind other windows, OS X checks to see if the app is performing any important task, such as downloading a file or playing music. If it isn't doing something the OS thinks is important, App Nap will be engaged, and the app will be put into a state of suspension.

This allows your Mac to conserve power, which lengthens the time your battery will last before it needs recharging, or, if you're connected to a power source, increases the efficiency of your Mac's use of energy.

Why App Nap May Not Always Be the Best Thing

Most of the time, App Nap can be a powerful tool for keeping a MacBook running when it's away from a power source; even desktop Macs can see less power consumption with App Nap. But it may not always be the best choice, depending on which apps are being forced to sleep.

The OS tries not to interfere with apps that are still performing tasks while in the background, but I have sometimes found one of my apps sleeping when I expected it to be working, thus prolonging a task that should have been completed much sooner.

In other cases, apps taking naps have failed to respond to an input they were supposed to make use of, such as an internal timer that tells an app to perform a task every x number of minutes.

Thankfully, there are two ways to control the App Nap function.

Controlling the App Nap Function

Before we delve into how to enable and disable App Nap, it's important to note that not all apps are App Nap aware.

Some apps can't be controlled by App Nap, nor will they respond to App Nap's enable and disable commands. Luckily, it's easy to tell which apps are App Nap aware and which ones are not.

Disable or Enable App Nap on an App-by-App Basis

App Nap is enabled by default in OS X, but there's an easy way to turn App Nap off for an individual application.

  1. Open a Finder window, and navigate to the app you wish to disable from napping; it will usually be in your /Applications folder.
  2. Right-click on the application, and select Get Info from the pop-up menu.
  3. Make sure the General area of the Get Info window is expanded. (Click the chevron next to the word General so it's pointed down.)
  4. If there's a Prevent App Nap checkbox present, you can put a check mark in the box to prevent naps, or remove a check mark to allow naps. If there's no checkbox, then the app isn't App Nap aware.
  5. You need to restart an app if you changed its App Nap checkbox setting while it was running.

Disable App Nap System-Wide

App Nap can be turned off across your entire system. This can be helpful for desktop Mac users, or those who always leave their MacBook plugged in. In those conditions, App Nap isn't a critical power-saving system, and you may prefer to allow apps to run background processes at any time.

  1. Launch Terminal, located in the /Applications/Utilities folder.
  2. In the Terminal window that opens, enter the following command:
    defaults write NSGlobalDomain NSAppSleepDisabled -bool YES

    Note: You can triple-click the above line of text to select the entire command. You can then copy/paste the command into the Terminal window.

  3. Press Enter or Return, depending on your keyboard. The command will be performed, although no feedback about the command's status will display in the Terminal window.

When you disable App Nap system-wide, you're not placing check marks in the Prevent App Nap checkboxes; you're simply turning the feature off system-wide.

Apps that would have responded to the App Nap feature will continue to do so if you re-enable the App Nap feature system-wide.

Enable App Nap System-Wide

If you've tried some of our other Terminal tricks, you most likely have already guessed that the command to disable App Nap can, with a slight change, be used to enable the napping feature system-wide.

  1. To enable Nap App system-wide, simply enter the Terminal command:
    defaults write NSGlobalDomain NSAppSleepDisabled -bool NO

    Note: Once again, you can triple-click the above line of text to select it, and then copy/paste the command into Terminal.

  2. Press Enter or Return on your keyboard, and the command will be executed.

Using the global App Nap enable command doesn't overwrite the App Nap settings of individual applications; it simply turns the service on system-wide. Each app can still be enabled and disabled individually.

Published: 2/23/2015

Was this page helpful?