Prevent Mac to sleep when lid closed on Mojave / Catalina So I saw a lots of old discussion on this topic, but I'm trying to find out an actual solution that still works on Mojave / Catalina, 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 criteria are met, and cannot overridden it.

 

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

 

So, which one gets the real deal ? Is Anti Sleep lying about it or Amphetamine (and all other caffeine app on the appStore) is 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...
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 1To revert, allowing sleep again:sudo pmset -a disablesleep 0