r/iOSProgramming • u/interlap • 3h ago
Tutorial A small trick to make iOS simulators use less RAM
iOS simulators start a lot of background daemons that you often don't need for development or CI. Siri, Spotlight, widgets, photo analysis, iCloud stuff, etc.
The good news is that Apple gives us a way to disable them.
For example:
xcrun simctl spawn <udid> launchctl disable system/com.apple.PosterBoard
Then reboot the simulator:
xcrun simctl shutdown <udid>
xcrun simctl boot <udid>
That disable is persisted in the simulator so the next time it boots, PosterBoard won't start.
Do this for enough unnecessary services and you can save a pretty decent amount of RAM.
The harder part is figuring out what is actually safe to disable, what breaks when you disable it, and then managing that across multiple simulators.
I ended up building SimSlim around this:
https://github.com/MobAI-App/simslim
It has a list of around 180 daemons that are safe to disable, grouped by feature, plus some convenient commands for slimming/restoring simulators and managing different profiles for local use or CI.
It's free and open source. Give it a try.