brandonjp Asked: 2019-04-02 10:33:33 +0800 CST2019-04-02 10:33:33 +0800 CST 2019-04-02 10:33:33 +0800 CST 如何在 macOS 的终端中切换切换(连续性)? 772 有没有办法从命令行启用/禁用 Handoff 设置? 目前,我正在使用 macOS Mojave 10.14.3,我知道我可以通过转到“设置”>“常规”>“允许切换”来切换它 - 但正在寻找替代方法。 macos command-line terminal 2 个回答 Voted Best Answer slhck 2019-04-11T22:56:05+08:002019-04-11T22:56:05+08:00 以下命令应关闭 Handoff: sudo -u $(whoami) defaults write "$HOME/Library/Preferences/ByHost/com.apple.coreservices.useractivityd.plist" ActivityAdvertisingAllowed -bool no sudo -u $(whoami) defaults write "$HOME/Library/Preferences/ByHost/com.apple.coreservices.useractivityd.plist" ActivityReceivingAllowed -bool no 再次开启: sudo -u $(whoami) defaults write "$HOME/Library/Preferences/ByHost/com.apple.coreservices.useractivityd.plist" ActivityAdvertisingAllowed -bool yes sudo -u $(whoami) defaults write "$HOME/Library/Preferences/ByHost/com.apple.coreservices.useractivityd.plist" ActivityReceivingAllowed -bool yes 来源:jamf.com – 请注意,我尚未验证这些命令,但 OP 声称它们可以正常工作。 Will Chang 2020-12-31T06:58:23+08:002020-12-31T06:58:23+08:00 @slhck 的回答可以简化为: 上: defaults -currentHost write com.apple.coreservices.useractivityd ActivityAdvertisingAllowed -bool yes defaults -currentHost write com.apple.coreservices.useractivityd ActivityReceivingAllowed -bool yes 离开: defaults -currentHost write com.apple.coreservices.useractivityd ActivityAdvertisingAllowed -bool no defaults -currentHost write com.apple.coreservices.useractivityd ActivityReceivingAllowed -bool no
以下命令应关闭 Handoff:
再次开启:
来源:jamf.com – 请注意,我尚未验证这些命令,但 OP 声称它们可以正常工作。
@slhck 的回答可以简化为:
上:
离开: