App Nap Mac Os
We were receiving complaints from several users that they would lose the connection to their published applications when working on their Mac OS X devices. When working on these devices their published applications would suddenly be disconnected. The users would receive the following message:
To boost battery life in OS X Mavericks, App Nap will slow down an app that is not being actively used. Of course you have the control to set which apps are being put to sleep. Mac OS X Mavericks. Mavericks is a great operating system for running different programs. This is because of the App Nap feature it has. This feature puts unused apps on a short nap when you switch to another app. The feature prevents other apps from taking up processing power. /top-mac-whiteboarding-app.html. Doing this helps the device prevent freezing because of having. App Nap fixes this problem. If you can’t see an app, and it’s not making noise or accessing OpenGL, the app will go into a suspended mode called “App Nap.” In this mode the app takes no actions, ensuring it stops draining battery life without actually quitting. If and when you return to the application, it will reawaken instantly.
While investigating the issue and some Googling by my colleague Patrick de Ritter we found that we where not alone. Beside the small note Dan Brinkman already wrote about this issue there is also a nice thread about the issue on the Citrix Discussions forum. To clarify this issue I decided to write an article about this issue.
The issue the users are experiencing seemed to be caused by a new feature in OSX 10.9 called app nap. It is a sort hibernation mode for applications and causes the above described effect for users. To prevent this from happening we took the following steps:
App Nap is an energy feature introduced to the Mac in OS X Mavericks that causes inactive applications to go into a paused state, helping to reduce power usage. The feature can help to prolong battery life for the MacBook line, and it can also make an impact on overall energy usage from the computer. See real-time CPU, network, or disk status in the Dock. It’s easy to keep an eye on your system status without even looking at the Activity Monitor window—you can monitor your CPU, network, or disk usage as a live graph right in the Dock.
- Select the check box at Prevent App Nap check box to prevent the application from hibernating.
Because the Citrix Receiver only handles the connection to StoreFront, you’ll also need to set this for the Citrix Viewer (previously known as the XenApp Viewer). - Use Command + I (or right-click the app, then click Get Info) to open the Get Info window.
- Open the Applications folder and find the Citrix Receiver.
- To do this, right-click the Citrix Receiver app and select Show Package Contents. Navigate to the Helpers folder, under the Contents folder, and use Command + I (or right-click the app, then click Get Info) to open the Get Info window for Citrix Viewer.
- Again, select the check box at Prevent App Nap to prevent the application from hibernating. After the user logs on again (because of the services running in the background), the application will never hibernate again for this user. That’s right, these settings are for the logged in user only.
- Besides changing the settings through the GUI it is also possible to create a script. This script can be started by the user and needs to run in the users context and is case sensitive:

defaults write com.citrix.Receiver.nomas NSAppSleepDisabled –bool TRUE
defaults write com.citrix.XenAppViewer NSAppSleepDisabled –bool TRUE
After the settings have been changed the user won’t experience disconnected sessions, caused by a hibernating application anymore. Remember the user needs to re-login before the changed settings will be effective
Please note: We tested this against Apple OS X 10.9
App Nap is an energy feature introduced to the Mac in OS X Mavericks (10.9) that causes inactive applications to go into a paused state, helping to reduce power usage. The feature can help to prolong battery life for laptops but can cause issues with Connected as it effectively puts the application to sleep and drops the network connection. There, 'App Nap' should always be disabled for Connected.
To disable App Nap:
1) Make sure the Connected application is closed.
2) Locate the Connected application in your Applications folder and highlight it with a single click so it is selected.
3) Go to the “File” menu and select “Get Info” (or select the app and hit Command+I)
4) Check the box for “Prevent App Nap”, found under the General section of Get Info screen, as shown in the following screen.
