Blog · CI/CD

Set up iOS CI/CD on a cloud Mac mini in an afternoon

A dedicated Mac mini as a self-hosted GitHub Actions runner: faster builds, warm caches and no per-minute macOS billing.

Hosted macOS runners are convenient, but every job starts from a cold machine: Xcode caches, Swift packages and simulators are downloaded again and again. A dedicated Mac keeps all of that warm, so the second build of the day is usually much faster than the first.

1. Prepare the Mac

  1. Connect over SSH with the details from your Hatmac account.
  2. Install the Xcode version your project uses with xcodes or from the App Store, then run sudo xcodebuild -runFirstLaunch.
  3. Install the command line tools you need, for example brew install fastlane swiftlint.

2. Register the runner

In your GitHub repository, open Settings → Actions → Runners → New self-hosted runner and choose macOS. GitHub shows the exact download and ./config.sh commands for your repository. Run them on the Mac, then install the runner as a service so it starts after a reboot:

./svc.sh install
./svc.sh start

3. Point your workflow at it

jobs:
  build:
    runs-on: [self-hosted, macOS]
    steps:
      - uses: actions/checkout@v4
      - run: xcodebuild -scheme App -destination 'platform=iOS Simulator,name=iPhone 16' test

4. Keep it healthy

  • Clean ~/Library/Developer/Xcode/DerivedData on a schedule if disk space gets tight.
  • Keep signing certificates in a dedicated keychain and unlock it at the start of the job.
  • Use one runner per Mac for predictable build times. Add a second Mac when the queue grows.

Need more than one runner? Teams often pair a Mac mini for everyday builds with a Mac Studio for large test matrices.

GitHub ActionsXcodeCI/CDiOS