MacOS - How to keep your MacBook awake, even when the lid is closed.

First off, we're going to show you how to accomplish to keep your MacBook awake after closing the lid in two simple steps. After that, we're going to explain why this isn't a feature of our Mac app Caffeinated.

Step 1: Open Terminal

There are several ways to find and open Terminal on your Mac. One of the quickest and easiest ways to open it is with Spotlight Search.

  1. You can use the keyboard shortcut Command + Space to open Spotlight Search on your Mac. Or click on the Spotlight Search button in your menu bar.

  2. Type in "Terminal".

  3. You should see the Terminal application under Top Hit at the top of your results. Double-click it and Terminal will open.

Step 2: Run Command

There are essentially two commands you will need. One for keeping your MacBook awake (even with the lid closed) and the second one you'll use whenever you'd like to let your MacBook sleep again.

Note: Keeping your MacBook running while the lid is closed, will potentially trap heat between the display and the keyboard of your MacBook.

1) Command to deactivate Lid-Sleep (keep system awake,开启合盖不休眠模式)

javascript 复制代码
sudo pmset -b sleep 0; sudo pmset -b disablesleep 1

2) Command to activate Lid-Sleep (let system sleep again, like normal,关闭合盖不休眠模式)

bash 复制代码
sudo pmset -b sleep 5; sudo pmset -b disablesleep 0

Simply copy the desired command from above and paste it in Terminal. Hit Enter . Since these commands are sudo commands, they require your password to run. Therefore, simply enter your password and hit Enter again. Voilà! That's how to keep MacBook awake with lid closed.

Why is this not a feature of Caffeinated?

Well, we would love to implement this feature, but for now it's simply not possible due to Apple's guidelines and restrictions for apps available on the App Store.

These limitations are not a bad thing, as they help preventing harmful software (malware) on your Mac. Apple tries to keep the system safe and clean. Even though this comes with limitations for us developers, we appreciate this, especially from a users perspective.

相关推荐
king13598745508 小时前
LFM2.5-24B-A2B Mac 本地部署:内存估算、GGUF/MLX 与 Python 预检脚本
人工智能·macos
骑着蜗牛撵大象3278 小时前
链路层不只是 MAC:以太网帧、ARP 与 802.1Q VLAN 的逐跳拆解
计算机网络·macos·ar·vlan·mac地址·链路层
一条泥憨鱼10 小时前
【计算机网络】| 从 MAC 到 NAT 的跨网段通信全链路
服务器·网络·学习·计算机网络·macos
老牛日常随笔1 天前
Meta 开源 8160 亿参数模型,官方给的方案是两台 Mac Studio
macos·开源
桌管小李2 天前
内网终端安全再升级|迪康端点安全 2609 版本四大新功能解读
大数据·windows·安全·macos·网络安全
情 九2 天前
Dify 本地环境搭建教程:macOS / Windows
windows·macos
2501_915918413 天前
在 Xcode 中运行和调试单元测试的完整指南
ide·vscode·macos·ios·单元测试·个人开发·xcode
Lalolander3 天前
灵基Lingee怎么下载安装?Mac 与 Win 详细指南
大数据·人工智能·科技·macos·金蝶灵基
老李IT笔记3 天前
远程取设备日志:iOS、tvOS 和 macOS 三端的同意方式不一样
macos·ios
JasonSJX3 天前
DRM-X 5.0 PDF 保护更新:Windows 与 Mac 打印保留用户水印,ZJGet iOS 版支持 PDF 阅读
macos·pdf