是否可以从终端启动ScreenSharing?


Answers:


23
open vnc://server.address[:port]

3
如果要传递某些凭据,则打开vnc:// user @ pass:server:port也可以使用。您需要考虑这样做的安全风险。
本·瓦尔丁

2
open vnc://user@server:port也是有用的,并且不存在在进程列表中显示密码所带来的安全风险
Michael

我从没想过要man open在今天之前打字。它可以做很多事情。
迈克尔·福克斯

2
使用密码的正确语法是vnc://user:password@server:port
levsa

知道使用VNC密码作为此参数的方法吗?谢谢
Peter Becich '17

2

如果您有权访问在系统偏好设置中激活的辅助设备,则可以尝试在AppleScript编辑器中保存以下AppleScript并通过命令行执行它:

tell application "Screen Sharing"
    activate # start Screen Sharing if not running yet
    tell application "System Events"
        keystroke "a" using command down # this will cause the address to clear
        keystroke "127.0.0.1" # replace with your host
        key code 36 # press enter
    end tell
end tell

另存为Sharing.scpt,并执行为osascript /path/to/Sharing.scpt

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.