38

When I try to download large apps from the App Store whether on battery or AC power the displays turns off after time set and downloading also stops.

The Energy Saver preferences are set to defaults.

What should I do to continue download even when display is off?

I am using OS X 10.9.4

12 Answers 12

56

If you don't want to install any software or change settings, you can use the Terminal utility caffeinate. Open Terminal (located in /Applications/Utilities/), type in caffeinate, and press return ↩︎.

If you want to set a timeout so it will go to sleep after some amount of time, use this:

caffeinate -t 3600

That will make it stay awake for an hour. (3600 is the number of seconds you want it to stay awake.)

To stop or cancel the caffeinate command, press ^ ControlC.

  • Best answer so far, so handy for terminal lovers! Gonna try it now. – Akash Agarwal Dec 23 '16 at 8:53
  • You could also caffeinate program [arguments] to make Mac awake as long as the program is running, which is handy for testing scripts over night: caffeinate python script.py. Love it! – taper Dec 29 '17 at 16:09
  • It needs to have the -s flag to prevent downloads from stoping. – JBis Jun 25 '18 at 1:44
11

You could set hot corners. Push the cursor to that corner & it won't nod off.

That would save you having to change the regular policy, for the times you do want it to sleep after being idle.

enter image description here

  • 1
    This would either disable the screensaver or put the display to sleep, it's not going to prevent the laptop from going to sleep right? – Prabhu May 13 '16 at 4:01
  • I haven't actually used it in years - my last 2 machines have never slept, in 8 years - but it used to be that if the screen didn't sleep, neither did the computer. Easy enough to test... – Tetsujin May 13 '16 at 19:17
  • The panels have changed and this is no longer accurate. Use "Energy saver" panel. – BondedDust Feb 21 '18 at 19:12
  • @BondedDust - you could either fully edit the new info into this answer, subject to approval, or add a new answer. I'm still on El Cap, where it's still true. – Tetsujin Feb 21 '18 at 19:27
  • Color me puzzled. I'm on El Cap too, but I don't get that graphic. – BondedDust Feb 21 '18 at 19:29
6

You could try Caffeine from the Mac App Store:

Caffeine is a tiny program that puts an icon in the right side of your menu bar. Click it to prevent your Mac from automatically going to sleep, dimming the screen or starting screen savers. Click it again to go back. Right-click (or -click) the icon to show the menu.

4

In you Energy Saver options, just change "Computer sleep" option. For exemple you could put "Computer sleep" option to "Never" While on Power Adapter.

Default option put your Mac to sleep after 15 minutes while on Power Adapter.

  • I did this, it worked great. – Flare Cat Jan 10 '16 at 18:12
3
  1. Check Prevent computer from sleeping when the display is off in the Energy Saver setting under System Preferences.
  2. Leave it or press shift+control+Power to turn off the Display.
3

you can use caffeinate -w <the Process ID of the download> for this.

  • caffeinate command makes your computer unable to fall asleep (although your display may),

  • the -w option makes it wait for a process to finish and before then your computer cannot fall sleep, which is exactly what you wanted to do.

to do so you can first find the Process ID(PID) for your download with Activity Monitor, then open up Terminal(bash) and type in for example caffeinate -w 4708, replace the number with the PID you found.

  • be careful with a low PID number as it may be a system process, in which case your computer may run on until the battery dies.

  • also if you plan on using this command often on certain processes, you may want to use caffeinate -w $(pidof <name of process>) instead, this will find the ID of the process you name each time (as PID is assigned by the system and will change each time you run it)

the advantage this has over

  • changing system preferences: it doesn't require you to change the preference back once you're finished

  • caffeinate -t <number of seconds>: your download may not finish in a certain amount of time, in that case the goal is not achieved; or it may finish really quickly, in that case you would be wasting energy.

2

I suggest Amphetamine, downloadable from the app store or here. Using the app, you can set up custom periods for your computer to sleep.

1

As I don't want to install any software nor want to use Terminal for such a trivial task (nor have found any setting allowing me to never have my Mac sleeping), I use this:

https://www.youtube.com/watch?v=G1IbRujko-A

Apparently, opening a Youtube video and keeping the focus on its tab prevents Chrome from sleeping (as you fake watching a video) and allows me to leave my computer (without anxiety) knowing that it won't sleep until the video ends. This gives enough time for any download to finish (unless the said download duration outreaches the video's one).

0

If you don't want it to sleep, just go to "System Preferences" then click "Energy Saver" then make your Mac's sleep auto to "Never". Then change it to "Normal" once download is done, Also one tip: attach the charger (or what ever you wanna call the charger I.E AC power etc.) while app/file/document/any other things are downloading.

If it's too complicated just go to "System Preferences" -> "Energy Saver" then set it to "Never".

0

Try NoSleep Application.

It is simple and has easy to use User Interface You can even close your lid and listen to music after that. Your App Store will continue downloading even after closing the lid.

0

After having tried a couple of similar apps I settled on InsomniaX — a free and open-source app that allows sleeping the screen while keeping the system on. The only annoyance I've found is that once in a while it asks for the user's password.

Installable via homebrew with:

brew cask install insomniax
-2

just leave a video running like a 8 hour sleep music video

  • 1
    Welcome to Ask Different! We're trying to find the best answers and those answers will provide info as to why they're the best. Answers should be self-contained so explain why you think the answer you provided will solve the problem or is better than others out there. Providing links as supporting information can also help the OP, and others, find additional info for themselves. See How to Answer on how to provide a quality answer. - From Review – fsb Aug 23 '17 at 17:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .