The system is designed to let the CPU idle when heat becomes an issue. Crashes indicate a bad software install or faulty hardware. Either of those can be worked out with Apple Support.
If you want to troubleshoot the software yourself, make a backup and then perform an erase install.
If you can crash the Mac with a clean install and no restore of your data or installation of third party apps - that's a perfect test to isolate hardware as the faulty item.
The problem is the macOS continues to check for updates (including email, software, news, etc.) while your MacBook Pro is asleep (this feature is called "Power Nap"). This means it's very quick to get up and running when you open your MacBook, but it also means your battery goes down while it's asleep.
The problem some people have is that even with "Power Nap" disabled, their battery still goes down as MacOS continues to check for updates (it's possibly other software checking online for things).
To fix this, you can tell you MacBook Pro to disconnect from the Internet while it's asleep, preventing online checks.
To do this, you need to set the tcpkeepalive
setting to 0
.
Open up Terminal and type:
sudo pmset -b tcpkeepalive 0
After you enter your password for sudo it gives you a warning saying some features may not work properly. This is fine, it simply disables Internet access during sleep.
You can check it is set correctly by running:
pmset -g
Which should show "tcpkeepalive 0
"
And you can, of course, reverse it at any time by running:
sudo pmset -b tcpkeepalive 1
Simple!
Note: You can also force your Mac not to connect to the Internet when it's asleep even when connected to a power supply, if you like: sudo pmset -a tcpkeepalive 0
. (Personally I don't mind as long as it's not using my battery, so -b
is fine for me.)
Also note: The results from pmset -g
will vary depending on if your MacBook Pro is connected to power or not when you run the command. It will reflect the current tcpkeepalive
setting, depending on its current power situation.
Best Answer
You'll need to keep your MacBook Pro awake while the lid is closed. There is no setting within macOS that lets you override the default behaviour (enter sleep mode when the lid is closed).
You can use a free 3rd party app called InsomniaX. It lets you disable the sleep mode while the lid is closed.
Image source: http://semaja2.net/ye-ol-projects/insomniaxinfo/