Skip to main content

Prevent Mac to sleep when lid closed on Mojave [Resolved]

So I saw a lots of old discution on this topic, but I'm trying to find out an actual solution that still works on Mojave, without the use of external monitor/keyboard/mouse/with power adapter.

When looking up Amphetamine, they claimed that you can only do it when the 4 criterias are met, and cannot overridden it.

Amphetamine

But on the other hands, Anti Sleep provide the feature in their pro version...

enter image description here

So, wich one get the real deal ? Is Anti Sleep lying about it or Amphetamine (and all other caffeine app on the appStore) out of date ?

I also heard about InsomniaX and built-in caffeine but it's really not user friendly, and appear not to be supported anymore...


Question Credit: Edd Growl
Question Reference
Asked July 9, 2019
Posted Under: Apple
16 views
1 Answers

You can accomplish this in terminal. No additional software needed.

Display global power settings:
pmset -g

System-wide power settings:
Currently in use:
 lidwake              1
 autopoweroff         1
 standbydelayhigh     86400
 autopoweroffdelay    28800
 proximitywake        1
 standby              1
 standbydelaylow      10800
 ttyskeepawake        1
 hibernatemode        3
 powernap             1
 gpuswitch            2
 hibernatefile        /var/vm/sleepimage
 highstandbythreshold 50
 womp                 0
 displaysleep         10
 networkoversleep     0
 sleep                1 (sleep prevented by sharingd)
 tcpkeepalive         1
 halfdim              1
 acwake               0
 disksleep            10



To stop sleep entirely:
sudo pmset -a disablesleep 1

To revert, allowing sleep again:
sudo pmset -a disablesleep 0


credit: CJ Dana
Answered July 9, 2019
Your Answer
D:\Adnan\Candoerz\CandoProject\vQA