Skip to content

feat(platform-ios): boot CI simulators with unused services already off - #304

Open
V3RON wants to merge 5 commits into
mainfrom
research/slimsim-ios-ci
Open

V3RON wants to merge 5 commits into
mainfrom
research/slimsim-ios-ci

Conversation

@V3RON

@V3RON V3RON commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

What is this?

This PR makes Harness boot iOS simulators on small CI hosts with their unused background services already off, instead of stopping them after a full boot. On the standard GitHub macOS runner (3 cores, 7 GB), the iOS E2E job drops from about 17–18 minutes to about 9–10 minutes.

Until now, Harness let the simulator boot with roughly 180 services running (photo analysis, widgets, Siri, iCloud sync and so on), then stopped 57 of them one launchctl call at a time. On a starved runner that step alone took 100–120 seconds, sometimes hit its 2-minute cap, and the boot had already paid the CPU and memory cost of starting those services. The code also assumed the disabled state lived only in CoreSimulator's memory and had to be redone on every boot. That assumption is wrong.

How does it work?

On iOS 18.5 and later, the simulator's launchd_sim keeps its disable overrides in a file on the host, /private/var/tmp/com.apple.CoreSimulator.SimDevice.<UDID>/disabled.plist, and reads it when the simulator starts. simslim uses the same file. When Harness boots a shut-down simulator on a host where slimming applies (CI with 3 cores or less than 8 GB, or slimOnCI), it first merges the services to disable into that file. The simulator then boots without starting them.

After boot, Harness reads launchd's state and only acts on services that are still enabled or running. After a pre-written boot this takes about 4 seconds and catches the occasional service that starts anyway. On iOS 18.4 and earlier, where launchd ignores the file, the same step stops the services after boot as before. A simulator that is already booted when Harness starts is left as it is.

The service list now follows simslim v0.9.0's default profile, with its store and web categories left on so push notifications, StoreKit, in-app purchases and universal links keep working. Compared with the previous list, it turns off more (wallpapers, Spotlight, on-device intelligence, health, messaging and more; 144 services). It no longer disables routined, biomed, biomesyncd and nanoprefsyncd.2, which simslim found break a simulator's boot. It also leaves gamed on, which XCUITest app launches wait on for about 10 seconds, and assistantd, without which Spotlight leaks memory.

This repo's iOS E2E and crash-validation jobs no longer boot the simulator in a workflow step, so Harness boots it and the services are off from the start.

Why is this useful?

  • Small CI runners stop being starved during startup. Measured in this repo's E2E iOS job, the slimming step goes from 101–120 s to about 4.5 s, peak compressed memory during startup from about 2.2 GB to 1.2 GB, and peak load during tests from about 110 to about 53. On a local iPhone 17 Pro simulator, memory went from 4.56 GB to 1.22 GB.
  • Startup no longer risks the slimming step running out of time and leaving services running, which preceded a permissions test timing out in one run of the old path.
  • Projects that use Harness or its GitHub Action on standard macOS runners get this without changing anything.
  • Features that apps commonly test (push, StoreKit, universal links) keep working, and services known to break a simulator's boot or XCUITest launches are no longer touched.

V3RON added 5 commits November 2, 2026 19:03
…mall CI hosts

Seed the simulator's launchd overrides before Harness boots it, so the
services never start, and align the service list with simslim v0.9.0.
Temporarily run the iOS E2E job as a seeded/live A/B with host pressure
sampling.
@vercel

vercel Bot commented Nov 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
react-native-harness Ready Ready Preview Nov 2, 2026 8:45pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — d3868349 Deployed Nov 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant