Turn Off Sleep
One of the ways to prevent your MacBook from going to sleep is to disable system sleep completely. This can be done in the Energy Saver system preferences. Also you can change the system setting to always running.
Use the Right Applications
There are many applications that you can use to prevent your MacBook from going to sleep. These include
– Caffine: This is a simple and effective application that installs a coffee bean in the top menu bar. You can click on this to prevent any kind of sleep mode on your MacBook. To turn off the application simply click on it again. However, this application does not prevent your MacBook from going to sleep when you close your MacBook.
– Caffeinate -t 3600: This application will help prevent your MacBook from falling asleep for a good one hour (3600 seconds). You can adjust the number of seconds depending on how long you want to keep your MacBook awake. The application causes the terminal to run a small operation so your MacBook does not sleep until the time set by you has lapsed. This is a simple and useful application.
– InsomniaX: This application advances your MacBook from going to sleep regardless of any circumstances. This application does not let your MacBook sleep even if the lid is closed. It is however not a good idea to keep the MacBook running for a long time when the lid is closed as your MacBook sometimes need rest as well.
– Sleepless: This can prevent your MacBook from going to sleep without the need for manually changing the system settings. Hibernation and sleeping settings can be scheduled on Sleepless. The application has recently been updated to prevent the MacBook from sleeping when closing it. It is however unwisely to use the application without caution so be sure that you do not overheat your MacBook.
– iWannaSleep: This application takes charge of your MacBook when it goes to sleep. This application is great for those who like to go to sleep while listening to music and do not want their MacBook to fall sleep. This allows you to set a time after which iTunes is to be stopped, the computer goes to sleep or is to shut down.
– Midnight: This is a great application that gives you an option of either putting your MacBook into a standard sleep mode or into hibernation mode. Standard sleep mode is where your MacBook reduces its power consumption to the minimum level by stopping its process but preserving RAM. Hibernation on the other hand copies RAM to your hard drive.
Idle sleep system prevention
The system when left idle for some time, without any power assertion, falls sleep. To prevent this from happening you can usually invoke power assertion. This can be done by opening the Terminal utility and running the 'pmset noidle' command, this will prevent the MacBook from sleeping. To stop the program you can press Control-C or simply close the terminal window that is running the command.