我正在尝试在 Mac 启动时加载协同功能,以便我可以使用鼠标/键盘登录。我按照这些说明进行操作
http://sourceforge.net/p/synergy2/discussion/199580/thread/76cf630a
我的 Synology 安装在 /Applications/Synergy.app/
plist 文件如下所示
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key> <true/>
<key>Label</key> <string>net.sourceforge.synergy2.loginwindow</string>
<key>LimitLoadToSessionType</key> <string>LoginWindow</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/Synergy.app/Contents/MacOS/synergyc</string>
<string>-f</string>
<string>-1</string>
<string>--name</string>
<string>mini</string>
<string>--debug</string>
<string>WARNING</string>
<string>192.168.1.200</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
但是我在 /var/log/system.log
中收到这些错误
synergyc[220]: 3891612: (connect_and_check) 登录前不允许不受信任的应用程序连接或启动 Window Server。
所有文件都拥有正确的所有权
-rwxr-xr-x 1 root wheel 893040 May 2 21:07 Synergy
-rwxr-xr-x 1 root wheel 3999988 May 2 21:07 synergyc
-rwxr-xr-x 1 root wheel 4269168 May 2 21:07 synergys
我已取消隔离
xattr -d com.apple.quarantine /Applications/Synergy.app/Contents/MacOS/*
我不知道还能做什么?为什么 OSX 这么难?我还能尝试什么?
附:我尝试了钩子(Hook)方法,但也不起作用。这种方法看起来更干净。
最佳答案
摘自 Apple 开发者技术说明 Daemons and Agents :
If, in Mac OS X 10.5 and later, you see a message like that shown in Listing 9 you might mistakenly think that the solution is to get the system to 'trust' your application, perhaps via code signing.
Listing 9: Pre-Login Trust Message
Untrusted apps are not allowed to connect to or launch Window Server before login.
However, this isn't the case. This message is really telling you is that you're trying to connect to the window server from the wrong context. You see this message if you try to connect to the global window server service from outside of the pre-login context before the user has logged in; typically this means that you're trying to use the window server from a daemon.
You should not attempt to fix this by convincing the window server to trust your program; doing so will just cause other problems further down the road. For example, if you do successfully connect to the window server from your daemon, you still have to deal with window server lifecycle issues described previously.
Instead, you should fix this problem by changing your code to run in the correct context. If you need to connect to the window server in a pre-login context, create a pre-login launchd agent. For an example of this, see Sample Code 'PreLoginAgents'.
在我看来,“正确”的方法会涉及对协同本身进行一些重写(请参阅上面的示例代码链接)。有一个synergy bug report on this ,三年前提交,但没有采取任何实际行动...我认为如果您希望修复它,就由您自己决定。
关于macos - 让 Mac 信任应用程序(登录窗口上的协同作用),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18603055/