2

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?

Community
  • 1
  • 1
Christian Goetze
  • 2,254
  • 3
  • 34
  • 51

1 Answers1

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.

pcjr
  • 419
  • 2
  • 6
  • testing this... ensuring autologin works is non-trivial, especially when remote... but that's a different problem. – Christian Goetze Feb 23 '17 at 17:31
  • I'll accept the answer so you can get the bonus... I still haven't gotten to the point of having it tested for my use case, but I got confirmation from different sources that this is indeed the right thing to do. I'll update once I can definitely confirm. – Christian Goetze Feb 24 '17 at 22:33