What you need
1. The Mac
Make a standard user for the runner, such asci, and sign in as that user for the rest of this page. Then:
- Turn on automatic login for it in System Settings › Users & Groups. After a restart, the runner and the simulators start again without anyone at the Mac.
-
Keep the Mac awake and have it restart after a power cut:
The display may sleep. Simulators don’t need it.
- Turn on Screen Sharing or Remote Login in System Settings › General › Sharing, to reach a Mac with no screen.
2. Xcode and a simulator
Install Xcode from the App Store, open it once, then:3. Mobster
Install Mobster for Mac, open it, and sign in. Start your free trial or pick a plan. Then prepare a simulator, so the first job doesn’t wait for one:4. The runner
- GitHub Actions
- GitLab CI
In your repository (or organization), open Settings › Actions › Runners › New self-hosted runner, and pick macOS and ARM64. Run the commands GitHub shows in
~/actions-runner, and add the mobster label when config.sh asks for labels:svc.sh install runs the runner as a LaunchAgent of the ci user. Keep it that way: a runner started as a system daemon can’t reach the user’s simulators, Keychain or iPhone.5. The iPhone
Skip this for simulators only.- Plug the phone into the Mac with a cable, and set it up in Mobster for Mac, signed in as the runner’s user (Device setup). Developer Mode stays on.
- On the phone, set Settings › Display & Brightness › Auto-Lock to Never, and keep it on its cable so it charges.
- Name it in the runner’s own environment, so a pull request can’t reach a phone the runner’s owner didn’t list:
- GitHub Actions
- GitLab CI
~/actions-runner/.env
./svc.sh stop && ./svc.sh start.MOBSTER_RUNNER_TESTFLIGHT lists the bundle IDs of TestFlight builds the jobs may test on the phone, the same way.
6. Check it
mobster ci init in your project (CI, GitLab CI).
Keeping it running
- Update Xcode and Mobster for Mac on the runner when you update them on your own Mac, so CI builds what you build.
- Delete simulators of runtimes you removed:
xcrun simctl delete unavailable. - Xcode’s DerivedData and old simulator runtimes fill the disk.
mobster ci doctorwarns under 30 GB free and fails under 10 GB. - One runner runs one job at a time. For more jobs at once, add a second Mac, and split the checks with
--shard(CI).