So, I’ve been working on an iOS project in Unity and wanted to build on a PC and just use a Mac for the signing step. This allows me to throw processing power at the build (the PC) and just use a low-end Mac Mini to handle the less labour intensive signing.

Technically, a Mac isn’t needed in the pipeline (PC’s can handle the sign) but I’m still a bit sceptical about signing final release builds on a PC, and would prefer to keep things safe by signing on the hardware and tools that Apple recommends.

Quick tutorial on setting up an OSX slave that can be used from the PC…

  1. Setup Jenkins on PC and Mac (I’m using 2.102 and it’s quite stable)
  2. Add a Slave Node
    1. In Jenkins, go to Manage Jenkins->Manage Nodes->New Node
    2. Enter a name (“Slave OSX” or similar)
    3. Select “Permanent Agent”
    4. Click “OK”
  3. On the page that follows (See below): –
    1. Set the Remote Root Directory for the slave (For me it’s /Users/Shared/Jenkins/slave)
    2. In Launch Method, select “Launch slave agents via SSH”
      1. Enter the IP of the slave
      2. Click “Add” on credentials to enter credentials that will allow your PC to connect to the Mac (See below for more info)
      3. Under “Host Key verification Strategy” I use “Manually provided key Verification Strategy”. Note: This is the rsa key of the Mac you’re connecting to. It IS NOT the rsa key needed to connect to the Windows PC. The rsa for the slave Mac can be found by typing “ssh-keyscan -t rsa [IP of Slave] on a terminal session on the slave Mac

AddSlaveNode

As mentioned above in point 3.2.2, the credentials for connecting to the Mac have to be set up. After clicking the “Add” button do the following: –

  1. Set the scope to “System”
  2. Add the username that you’ll be using to log in to the Mac
  3. Set the private key to the private key generated for this PC. See my other post here to get info on how to do this. The same post will talk you through configuring the Mac to work with password-less access via an authorized_keys file

ConfigCredentials

And that’s it. When you launch the node it should connect to the Mac and you’ve got a Mac slave. I’ll add another post on how to setup the signing soon.