Remote Mac for Xcode: Setup, Builds and CI on a Cloud Mac
Tips for working efficiently with Xcode on a remote Mac: setup, building over SSH, the signing keychain, the simulator, disk cleanup and automated builds with a GitHub Actions self-hosted runner.
Working with Xcode on a remote Mac is not very different from having a Mac on your desk; you just change a few habits. This guide shows how to prepare a rented or remote Mac for Xcode, run builds over SSH and turn the Mac into an automated build machine.
Quick summary: Install Xcode with your own Apple ID, run day-to-day builds with
xcodebuildover SSH, and use VNC for tasks that need the interface (signing settings, the simulator). Because the Mac is on 24/7, it can also be your own build machine for GitHub Actions or GitLab. See our Mac plans in Istanbul on the Mac mini rental page.
What hardware is enough on a remote Mac?
- RAM: 16 GB is comfortable for a single app project and one simulator. Several simulators at once, large Swift projects or Unity builds run faster with more RAM.
- Disk: Xcode and the simulator runtimes take tens of GB, and the DerivedData folder grows over time. 256 GB is enough for one project, but it needs regular cleanup (see below).
- CPU: Apple silicon (M-series) chips are very fast at compiling; our ready Mac minis have the 12-core Apple M6 (M4 on request).
1. Install and prepare Xcode
Connect to the Mac's desktop over VNC and download Xcode from the App Store with your own Apple ID. Then in Terminal:
sudo xcode-select -s /Applications/Xcode.app
sudo xcodebuild -license accept
xcodebuild -downloadPlatform iOS
If you need several Xcode versions, the xcodes tool makes it easy to install them side by side. Install Homebrew as well; you will need it for CocoaPods, Fastlane and other tools.
2. Run builds over SSH
You don't need to open the desktop for every build. Connecting over SSH and using xcodebuild is faster and works fine even on a slow connection:
xcodebuild -workspace App.xcworkspace -scheme App \
-configuration Release -archivePath build/App.xcarchive archive
xcodebuild -exportArchive -archivePath build/App.xcarchive \
-exportOptionsPlist ExportOptions.plist -exportPath build
You can take the ExportOptions.plist file from the folder created when you export once by hand in Xcode.
The keychain lock
If you see errors such as "errSecInternalComponent" when signing in an SSH session, the login keychain may be locked. Unlock it before building:
security unlock-keychain ~/Library/Keychains/login.keychain-db
3. VNC for tasks that need the interface
Connect to the desktop over VNC to change signing settings, upload from the Organizer or try your app in the iOS Simulator. When you connect to a Mac in Istanbul from Turkey or nearby countries, latency is low and the simulator feels smooth. For connection settings and a secure tunnel, see Connecting to a remote Mac over VNC and SSH.
You can also manage simulators from the command line:
xcrun simctl list devices
xcrun simctl boot "iPhone 16"
4. Make the Mac your build machine
Since the Mac is always on, you can use it as your own CI machine.
GitHub Actions self-hosted runner: in your repository go to Settings → Actions → Runners → New self-hosted runner, choose macOS and the ARM64 architecture. Run the commands GitHub shows you on the Mac over SSH, then install the runner as a background service:
./config.sh --url https://github.com/user/repo --token GITHUB_TOKEN
./svc.sh install
./svc.sh start
Put runs-on: self-hosted in your workflow file to send builds to this Mac. GitLab Runner and Jenkins agents are set up on macOS in a similar way.
TestFlight with Fastlane: brew install fastlane, then fastlane init in your project folder. With an App Store Connect API key, the upload_to_testflight action can send every build to TestFlight automatically.
For the full Fastlane setup (API key, signing, build numbers) see upload to TestFlight with Fastlane.
5. Keep the disk clean
If the remote Mac's disk fills up, builds fail. Check these folders once a month:
rm -rf ~/Library/Developer/Xcode/DerivedData
xcrun simctl delete unavailable
du -sh ~/Library/Developer/Xcode/Archives
Deleting old archives and simulator runtimes you don't use (Xcode → Settings → Platforms) can free tens of GB.
6. Security and backups
- Change your password at first login and use a key for SSH.
- Back up your signing certificates (.p12) and App Store Connect API keys somewhere safe.
- Keep your code in a Git repository; treat the Mac as a build machine, not as the only copy.
If you are wondering when renting makes more sense than buying, read Rent or buy a Mac mini?. If you have never had a Mac and are publishing for the first time, start with How to publish an iOS app from Windows.
Frequently Asked Questions
Is Xcode slow on a remote Mac?
The build runs on the Mac's own processor, so speed depends on the Mac's hardware; your connection does not slow the build down. Only the VNC picture depends on your connection speed. If you run daily builds over SSH, you won't notice the difference.
Is 16 GB of RAM enough for Xcode?
It is usually enough for one app and one simulator. If you run several simulators at once or build large projects, a plan with more RAM is more comfortable.
Can several developers use the remote Mac?
Yes, several people from the same team can connect over SSH, and macOS lets you create separate user accounts. The Mac is still rented to a single customer (your team).
Why a self-hosted runner when GitHub Actions has its own macOS machines?
GitHub-hosted macOS machines are billed per minute and every job starts on a clean machine. On your own Mac, dependencies and caches persist, builds start faster and the cost is a fixed monthly fee.
You might also like
Turn a rented Mac mini into a GitHub Actions or GitLab self-hosted runner for your iOS and macOS projects: set...
For iOS and macOS development, is it smarter to buy a Mac mini or rent a remote Mac? Cost maths, how often you...
How to connect to a rented or remote Mac from Windows, macOS and Linux over SSH and VNC (Screen Sharing): SSH...