Direct answer
Yes, it can be cleaned. Work through derived data, archives, simulators, old Xcode versions and the runner work folder in order of size. The first few are rebuilt automatically after deletion; for archives, confirm they are saved elsewhere first.
Basis
~/Library/Developer/Xcode/DerivedData: intermediate build products and indexes, usually the largest chunk. Deleting all of it is safe; the price is that the next build is a full build.~/Library/Developer/Xcode/Archives: the.xcarchiveproduced by each archive, containing symbol files. Versions that have shipped will still be needed to symbolicate crash logs later, so confirm they are uploaded or saved elsewhere before deleting.~/Library/Developer/CoreSimulator: simulator device data and runtimes.xcrun simctl delete unavailabledeletes devices the current Xcode can no longer use. Runtimes for old OS versions you no longer test can be removed in Xcode's settings.- Others: each additional Xcode version takes a large chunk of space; the runner's
_workfolder keeps a checkout and build outputs for each repository;brew cleanupclears old Homebrew versions; for container images, usedocker system prune.
Boundaries: when the answer is different
All of this is cleaning up your own files. Do not delete system folders you do not recognize, or the platform's management and remote control components, to free up space. Cleanup only eases the problem. If the project itself needs several Xcode versions and several sets of simulators kept at once, enough disk capacity should have been chosen when ordering. External storage requires arranging purchase and delivery with support first; you cannot simply mail a drive in and use it. The build machine should not be the only place artifacts are stored: app packages and archives should be uploaded after every build, so that you can clean up without hesitation.
How to do it
- In Terminal, use
du -sh ~/Library/Developer/*to see which category is largest. Do not delete by guesswork. - Confirm the archives you need are saved elsewhere, then clear out the expired part of the archives folder.
- Delete derived data and run
xcrun simctl delete unavailable. - Uninstall old Xcode versions and simulator runtimes you no longer use.
- Put the cleanup above into a script, let a nightly job run it regularly, and send a notification when free disk space falls below a threshold you set.
Related questions
- Can a self-hosted runner keep DerivedData and dependency caches between builds?
- Do I need to back up the data on a remote Mac mini myself?
- Can I use a rented Mac mini for automatic nightly builds?
- Rented Mac mini as an always-on build machine for small teams? Count your build minutes first
- Can I run XCUITest and the iOS simulator on a remote Mac mini?
Use case
This question belongs to the use case: Rented Mac mini as an always-on build machine for small teams? Count your build minutes first
Other questions in the same use case:
- Runner shows Offline and jobs stay queued: what to check first
- Which user account does a CI runner run as on a rented Mac?
- Locked keychain or signing error in CI on a rented Mac: how to fix it
- Can I install a CI runner as a system boot service on a rented Mac mini?
Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support