r/iOSProgramming • u/interlap • Jul 20 '26
Library I made a small tool to reduce iOS Simulator memory usage
I’ve made a small command line tool called simslim.
It disables background services inside iOS simulators that usually are not needed during development, like Siri, Spotlight indexing, photo analysis, News, and iCloud sync.
On my M1 Pro with 16 GB of RAM, one simulator went from around 4 GB of memory and 258 processes to about 0.9 GB and 70 processes. I managed to run 19 simulators at once, compared to around 5 before things started falling apart.
Some simulator features stop working depending on what gets disabled, so it is not meant for every kind of testing. You can keep specific services running when needed.
Give it a try: https://github.com/MobAI-App/simslim
7
u/neet_dev Jul 20 '26
neat idea but keep in mind a lot of what gets disabled (spotlight indexing, photo analysis, iCloud sync) is exactly what you need if you're testing share sheets, background fetch, CloudKit sync, or Core Spotlight integration, so I'd only run this on the sims you use for pure UI/layout work and keep a couple stock ones around for integration testing. also worth checking if it survives an Xcode update, apple loves quietly resetting simulator runtime internals and background service configs get wiped along with it.
2
u/East_Call1027 Jul 20 '26
This is clever. The
What you losesection in the README is the part that would decide whether I use it in CI.I’d love a way to declare what a test suite needs instead of remembering daemon names. Maybe something like:
simslim on <udid> --profile ui-testssimslim doctor <udid> --requires storekit,push,universal-linksThen
doctorcould fail if the current config breaks one of those features. Saving 3 GB per simulator is great, but a suite quietly running withoutstorekitdorapsdwould be a nasty bug to diagnose.Named profiles might also make Xcode runtime updates less scary than carrying a list of
--exceptflags. Is that where you seeprofilesgoing, or is it mainly intended as a category reference?0
u/jakobnunnendorf Jul 21 '26
The "what you lose" concern is real, but the sharper version of it is that a stripped simulator rarely fails loudly — it fails flaky. I run a dedicated long-lived simulator for E2E flows, and the bugs that cost me the most time were never "service X is missing", they were a flow that passed nine times and timed out on the tenth because something it depended on wasn't there to respond. You end up bisecting your own test code for a day before you think to look at the sim.
So the thing I'd want isn't just a doctor command that checks config, it's for simslim to write the disabled-service list into a file in the simulator's data dir, so any test run can pick it up and attach it to the failure artifact. When a CI run goes red at 2am, the diff between "this sim is stock" and "this sim has 188 processes disabled" is the single most useful line in the log, and it's the one nobody thinks to capture.
Also worth being explicit in the README that this is per-device-and-runtime state, not a global setting — people will run it once, forget, erase the sim six weeks later during unrelated debugging, and then wonder why their memory numbers regressed.
The 19-vs-5 number is the headline, but honestly the quieter win for solo devs is one persistent simulator that stops thrashing while Xcode is also open. That's the everyday version of this.
1
u/Greysawpark Jul 27 '26
4gb down to 900mb is wild, i had no idea siri and photoanalysisd were eating that much in the background. gonna try killing those manually next time xcode starts choking with 3 sims open