mac睡眠状态下远程唤醒
Does your Mac go to sleep at inopportune times? Would you like to keep it awake, but don’t want to install additional software? With this tiny little command line trick, you can keep your Mac awake for a specified durations or indefinitely.
您的Mac是否会在不适当的时间入睡? 您想保持其唤醒状态,但不想安装其他软件吗? 使用这个微小的命令行技巧,您可以使Mac在指定的持续时间内或无限期保持唤醒状态。
In the past we’ve told you that you can use a handy little app called Caffeine to keep your Mac awake. Caffeine is great because it has been around awhile, it’s free, and it just plain works. But, you may not want to install and run an application for such a simple function, which can be accomplished just as easily from a Terminal window.
过去,我们曾告诉过您,您可以使用方便的小应用程序Caffeine来保持Mac的清醒状态。 咖啡因很棒,因为它已经存在了一段时间,它是免费的,而且很简单。 但是,您可能不希望安装和运行如此简单的功能的应用程序,而该功能可以从“终端”窗口中轻松完成。
To open the Terminal, you can either open the Applications > Utilities folder and double-click it from there, or invoke Spotlight with Command+Space and search for it.
要打开终端,可以打开“应用程序”>“实用程序”文件夹,然后从中双击它,或者使用Command + Space调用Spotlight并进行搜索。
Once the Terminal is open, simply type caffeinate
, press Enter, and your Mac will stay awake for as long as you leave the Terminal running. You can minimize or hide it, and your Mac will not go to sleep until you use the keyboard shortcut Ctrl+C to interrupt the command.
打开终端后,只需键入caffeinate
,然后按Enter,只要您使终端保持运行状态,Mac就会保持唤醒状态。 您可以将其最小化或隐藏,直到使用键盘快捷键Ctrl + C中断命令,Mac才会进入睡眠状态。
Okay, that’s great, but the Caffeine application allows you to set how long the computer stays awake. What about using the Terminal method?
好的,那很好,但是Caffeine应用程序允许您设置计算机保持清醒状态的时间。 使用Terminal方法怎么样?
No problem, the Terminal can do that too. In fact, unlike Caffeine, you can choose any duration you like, not just a specific duration from a list. In this case, we’ve specified we want to add a duration using the switch -t
plus time in seconds. In this case, we’re allowing the computer to stay awake for 3600 seconds (or one hour).
没问题,终端也可以做到。 实际上,与咖啡因不同,您可以选择自己喜欢的任何持续时间,而不仅仅是列表中的特定持续时间。 在这种情况下,我们已经指定要使用-t
秒为单位的时间来添加持续时间。 在这种情况下,我们允许计算机保持清醒状态3600秒(或一小时)。
We’ve added an ampersand (&
) to the end of the argument so that the command runs in the background. Using &
allows us to continue to use the terminal while the caffeinate
command runs in the background.
我们增加了一个与符号( &
)的参数的结尾,以便命令在后台运行。 使用&
可使我们在caffeinate
命令在后台运行时继续使用终端。
There are other arguments you can apply to the caffeinate
command as well.
您还可以将其他参数应用于caffeinate
命令。
To prevent the display from sleeping, use caffeinate -d
. To prevent the system from idle sleeping, use caffeinate -i
. If you want to prevent the disk from going idle then you want to use the “caffeinate -m” command.
为了防止显示器Hibernate,请使用caffeinate -d
。 为了防止系统空闲睡眠,请使用caffeinate -i
。 如果要防止磁盘空闲,则要使用“ caffeinate -m”命令。
Finally, and this one is particularly useful for laptop users, if you want keep your system awake while it is plugged into AC power, use caffeinate -s
.
最后,这对于笔记本电脑用户特别有用,如果您想让系统在插入交流电源时保持清醒状态,请使用caffeinate -s
。
Of course, if you don’t want to use the command line, you can always change the sleep timeout in the Energy Saver preferences.
当然,如果您不想使用命令行,则始终可以在“节能器”首选项中更改睡眠超时。
However, this isn’t exactly the most convenient method if you want to make easy sleep changes on the fly.
但是,如果您想即时更改睡眠方式,这并不是最方便的方法。
So, there you have it, keeping your Mac awake is just that simple. You can either use the Caffeine app, the caffeinate
command, or adjust the Energy Saver settings. Whatever method you decide to use, we’re sure you’ll find it easy to keep your Mac from sleeping.
因此,有了它,保持Mac唤醒就这么简单。 您可以使用Caffeine应用程序, caffeinate
命令或调整“节能器”设置。 无论您决定使用哪种方法,我们都可以确保您轻松地使Mac保持睡眠状态。
翻译自: https://www.howtogeek.com/245683/how-to-prevent-your-mac-from-sleeping-with-no-additional-software/
mac睡眠状态下远程唤醒