【问题标题】:Mac terminal check if screen sharing is enabledMac终端检查是否启用了屏幕共享
【发布时间】:2018-06-22 14:20:21
【问题描述】:

我现在正在研究一种方法来跟踪屏幕共享是启用还是禁用。到目前为止,我已经尝试了两种方法,使用

检查启动文件是否存在
[[ -f /etc/com.apple.screensharing.agent.launchd ]] && echo 'enabled' || echo 'disabled'

我还尝试了一个读取命令,使用以下命令检查禁用变量的布尔值。

sudo defaults read /var/db/launchd.db/com.apple.launchd/overrides.plist com.apple.screensharing -dict Disabled -bool false

有什么我遗漏的或者我还没有尝试过的方法吗?

任何帮助将不胜感激!

【问题讨论】:

    标签: macos terminal macos-high-sierra


    【解决方案1】:

    这些选项对我也不起作用,我使用了
    sudo launchctl list com.apple.screensharing,如果它正在运行,它将成功,因此启用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-10-01
      • 2021-05-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-01-03
      相关资源
      最近更新 更多