To prevent your Mac from going to sleep after a certain amount of time, you can adjust the sleep settings in the Energy Saver preferences. Here’s how you can do it:
1. Click on the Apple menu in the top left corner of your screen and select “System Preferences.”
2. In the System Preferences window, click on the “Energy Saver” icon.
3. You will see two tabs: “Battery” and “Power Adapter.” Make sure you select the appropriate tab based on whether your Mac is running on battery or connected to a power adapter.
4. In the Energy Saver preferences, you will find a slider for “Turn display off after.” This setting controls how long your Mac’s display remains active before it goes to sleep. If you want to prevent your Mac from sleeping when the display is off, you need to adjust this setting accordingly.
5. Move the slider to a higher value to increase the time before the display turns off. If you want to prevent your Mac from sleeping altogether when the display is off, move the slider to “Never.” This way, your Mac will stay awake even if the display is turned off.
6. Additionally, you can also adjust other settings in the Energy Saver preferences to further customize your Mac’s sleep behavior. For example, you can prevent your Mac from sleeping when it’s connected to a power adapter by unchecking the box next to “Put hard disks to sleep when possible.”
By adjusting these settings, you can ensure that your Mac stays awake even when the lid is closed or the display is turned off. Keep in mind that preventing your Mac from sleeping can affect its power consumption, so it’s important to find a balance that suits your needs.
I hope this helps! Let me know if you have any further questions.