问题
This is a follow-up of Running ios-sim with Jenkins - I need a way to make this work when the Jenkins slave is run via ssh, and not via launchctl
So, in general, how can I access the display if I log onto a mac using ssh?
回答1:
I think you have to login to the Mac (Jenkins slave) using the user that you are using with the ssh connection. Once logged in, the jobs you run should be able to access the display.
We start the Jenkins slave on our Mac machine using "Launch slave agents on Unix machines via SSH" Launch Method. We have SSH credentials configured on the master and slave so this is seamless. My Mac slave is located a great distance from me. I can't currently connect to it to see if it matters who is logged in. Perhaps it doesn't have to be your ssh login.
Edited to add: Ideally you would not need to use "sudo" to run your command. But, you might have to.
来源:https://stackoverflow.com/questions/41862327/on-a-mac-sierra-how-can-i-give-an-ssh-session-access-to-the-display