DocsA Mac as a node of desk

A Mac as a node of desk

A Mac runs the workflows that only macOS can run: an Xcode build, a code signature, an archive for TestFlight. This page makes one Mac a persistent node of an org. The node takes the publishes of the lane ios and the checks of lane: "ios".

What the Mac needs

  1. Node 20 or later.
  2. desk and sealkeep on the PATH of the user.
  3. Xcode, with its command line tools: run xcode-select --install and xcodebuild -version.
  4. A certificate and a provisioning profile for the signature, in the login keychain of the user.

Make the node

  1. Run desk runner add mac-runner --org acme --lane ios. The command makes the identity of the runner and keeps its token in sealkeep.
  2. Run desk runner service install mac-runner --lane ios --org acme. The command writes ~/Library/LaunchAgents/com.munhq.desk-runner.mac-runner.plist and loads it with launchctl bootstrap gui/<uid>.
  3. Run desk runner service status mac-runner. It prints loaded, running and the last 5 lines of the log at ~/Library/Logs/desk-runner-mac-runner.log.
  4. Run desk runner list --org acme on any machine. The Mac shows with the lane ios, its host name, and the state idle while it polls for runs. It shows gone only when it sent no poll and no sample for 60 s (docs/runs.md).

The service starts when the user logs in, and it starts the runner again when the runner stops. It holds no token: it runs sealkeep run <secret> -- desk runner ..., and sealkeep gives the token to the process.

The keychain and the signature

The runner starts at login, so the login keychain is open. A command that signs reads the certificate from that keychain. A keychain that needs a password at each use stops the build with an error of codesign.

  1. Put the certificate and the provisioning profile in the login keychain of the user.
  2. Run one publish by hand in the same session, and give the keychain the permission to use the key. The build then signs with no prompt.
  3. If the Mac restarts and no user logs in, the service does not start. Enable the automatic login of that user, or start the service after the login.

A Mac that never sleeps serves the lane at any hour. Set the energy settings to prevent sleep, or keep the Mac on power.

The lane

A node of the lane ios claims only the runs of its lane: the iOS publishes and the checks that name lane: "ios" (#164, #170). It never claims a check of the lane runs or mobile. The checks of a build on a Mac are the same checks that the config gives: the lane only selects the machine.

Stop the node

Run desk runner service uninstall mac-runner. The command stops the service and removes the plist. Run desk runner remove mac-runner --org acme to stop its tokens and its keys.

The folder of the runs

The service builds each run below ~/.local/state/desk-runner-<name>, the same path as on Linux. Before 2026-11-20 the folder on a Mac was ~/Library/Application Support/desk-runner-<name>. The space in that path broke the iOS build: the Sentry Xcode phases and sentry-xcode.sh run an unquoted path, and xcodebuild archive ended with exit 65 (bash: /Users/<you>/Library/Application: Permission denied). A runner that an older desk installed keeps the old folder until you run desk runner service install <name> --lane ios ... again with the new desk. The runner logs a warning at start when its folder holds a space.

The right of a Mac runner

A Mac runner needs only the right run on the repositories it publishes. A publish run puts its bundle as a file of the run and creates the release with the lease of its claim (headers x-desk-run and x-desk-lease), so it needs no write on the code (munhq/desk#255). Before 2026-11-20 the attach used the code routes, and the iOS publish of munhq/leon failed after its build with 403 mac-runner has no write right.