For macOS imagers using version 10.13 (High Sierra), Apple has once again changed their OS policies regarding AppNap. A little over zealous I think in their attempt to prolong battery life for the legions of their users who they seem to think these days use their Mac's for nothing more than shopping and entertaining themselves... yes, I am starting to get a little bitter in my old age perhaps, but people who "work" on a Mac are finding themselves more an more at odds with an OS that seems to be more and more geared towards keeping people entertained and shopping instead of trying to get any creative work done. I miss the old Apple...
But enough bitter old man talk, what's the deal here? Well, the deal is that in the past you could set a flag for a particular app so that it was immune from the AppNap sand man that would put them to sleep. You could do this via the user shell, by right clicking, selecting "Get Info", and clicking the "Prevent AppNap" checkbox. Vendors (us) could also set a special flag in our application bundle so we could tell the OS in advance that we should not be indiscriminately put to sleep (and we do do this, so this it isn't an issue on previous macOS releases).
All of the above is gone with macOS 10.13 (High Sierra). I'm sure the Apple engineers have thought long and hard about the "heuristics" (their wording) of whether an app is actually doing anything important, but they seem to have neglected the use case of an imaging application that is controlling cameras, focusers, and other imaging devices. With the latest version of Sierra, you can start a full on focus run, cover up TheSkyX, and it will just stop. If you wait long enough to notice, it will even drop the USB connection (or at best corrupt the communications flow). I discovered this the hard way because I can only watch so many focus runs (while developing @Focus3) without having to maybe check email, or do some other tasks on my computer at the same time. If you're the kind of imager that starts an image run on the Mac, and leaves it (no screen saver either buddy!), then no problem, but.... This discovery also explains why my image runs lately will mysteriously just STOP in the middle of the night, now I know it's occurring when my display goes to sleep (I have it set for a pretty long while, and I just turn the brightness way down).
I'm sure astronomical imaging is a tiny blip on their radar, but who in a meeting room said, "yeah even if the app is continually sending and receiving info over a USB port... we should still go ahead and tranquilize it because the user isn't paying attention..."?
This is easy to demonstrate too. Start TheSkyX, and bring up the Activity Monitor. On the Energy tab, there's a column that shows when a program has been told to lay it's head down on it's desk for a while with the lights off (AppNap). Cover up TheSkyX and this column will go Yes very shortly. Doesn't matter if we are continually making tracking adjustments, moving the focuser, downloading guiding images, etc. Yes, another reason I'm championing more and more using a dedicated Linux box for controlling your imaging run instead of a desktop/consumer operating system.
The only way I've found to alleviate this issue is to disable AppNap at the OS level for everything. Open a terminal window and type the following (followed by return):
defaults write -g NSAppSleepDisabled-booltrue
Now be warned dear user of the consequences of doing this. If you start a video or something, and put it in the background, it will continue to drain your laptop battery for no good reason.
Of course it also won't put your imaging run to sleep should you decide to watch a video or even read your email while it works in the background ;-)
Richard