Skip to content

Keep gamed enabled to avoid XCUITest launch delays - #57

Merged
Interlap01 merged 2 commits into
MobAI-App:mainfrom
clindsay3:codex/keep-gamed-for-xctest
Oct 8, 2026
Merged

Interlap01 merged 2 commits into
MobAI-App:mainfrom
clindsay3:codex/keep-gamed-for-xctest

Conversation

@clindsay3

Copy link
Copy Markdown
Contributor

Disabling com.apple.gamed added about 10.4 seconds to each warm XCUITest app launch with Xcode 27.0 (27A266a) and iOS 18.6 (22G86) on Apple Silicon. This keeps it enabled by default using the existing AlwaysEnabled compatibility mechanism.

Evidence

Each condition in the table used the same short test three times on a fresh iPhone 13 mini simulator. Values below are medians of warm iterations 2 and 3; first-launch work is excluded.

Condition Disabled services Pre-automation gap
Stock 0 0.210 s
Original slim profile 108 10.714 s
Only com.apple.gamed disabled 1 10.619 s
Original profile with gamed kept 107 0.212 s

The measured gap ends at XCTest's Setting up automation session activity and starts at completion of the preceding app-termination activity. It is not a first-visible-frame metric. The complete XCTest Launch activity also dropped from about 14.2 s to 3.4 s when keeping gamed.

All 39 short iterations across 13 bisection/control conditions passed. The original and amended full profiles differed by exactly one disabled label, verified from the disabled-service inventory. These experiments used simslim 0.11.0 and an existing Debug app/XCUITest, not a standalone minimal sample. Other Xcode/runtime combinations have not been checked.

During the slow gap, launchd reported failed lookup for com.apple.gamed, requested by DTServiceHub; that tooling process logged a GameKit XPC connection error (NSCocoaErrorDomain 4099). Sampling the app showed its main thread at _dyld_start +0, without app-code frames. Keeping gamed removed the failed lookups. The controls isolate the local trigger, but the exact private tooling call or timeout remains unconfirmed.

Original profile:

simslim on <UDID> --no-reboot \
  --except store,photos,web,icloud,connectivity \
  --keep com.apple.mobileassetd

On a separate fresh simulator, adding com.apple.gamed to the keep list removes the delay. Use fresh simulators or restore stock through the reboot path between conditions: on --no-reboot does not re-enable services already disabled.

Changes

  • Move gamed from apps.Labels to apps.AlwaysEnabled, with a visible explanation. Other game services remain slimmable.
  • Retain it in the mutation allowlist so a normal reboot-based on or off repairs devices slimmed by older versions.
  • Preserve JSON workaround profiles containing keep: ["com.apple.gamed"]. Unknown labels remain rejected.
  • Keep doctor --requires game-center compatible and able to detect legacy disabled state.
  • Document the measured versions, workaround, and the existing --no-reboot repair limitation.

Validation

  • The new gamed regression failed against upstream's original profile and passes with this change.
  • make check passed: all Go tests, go vet, Swift formatting lint, shell syntax, and plist lint.
  • Behavioral evidence above comes from the controlled 0.11.0 keep-list experiments. This patch has pure unit coverage; no additional simulator run was performed for the PR.

Draft for maintainer discussion. No changes to live-bootstrap behavior or other service selections are included.

Chris Lindsay's AI and others added 2 commits October 8, 2026 12:35
Controlled Xcode 27.0 / iOS 18.6 experiments isolated com.apple.gamed as
the trigger for an approximately 10.4-second warm app-launch delay.
DTServiceHub attempted to reach the disabled GameKit service while the
app remained before application code. Keeping only gamed enabled removed
the delay with every other service selection unchanged; the exact private
tooling timeout remains unconfirmed.

Use the existing AlwaysEnabled mechanism instead of deleting gamed from
the allowlist, so normal reboot-based on/off operations can also repair
devices slimmed by earlier versions. Preserve the game-center diagnostic
and accept managed always-enabled services in JSON keep lists, keeping
existing workaround profiles valid while still rejecting unknown labels.
Leave live no-reboot re-enabling semantics and other game services alone.

Add regressions for default selection, legacy repair, profile compatibility,
and the existing diagnostic. Document the tested environment and repair
limitation. The gamed regression fails on the original profile and all
make check gates pass after the change. Launch measurements were collected
with the equivalent keep-list control before this patch.

This commit was created by AI.
@Interlap01

Copy link
Copy Markdown
Contributor

Thank you! This is a very useful finding. I just removed the explanation from the README. The reason for keeping gamed enabled is in the code comment, which should be enough.

@Interlap01
Interlap01 marked this pull request as ready for review October 8, 2026 11:38
@Interlap01
Interlap01 merged commit 60ba269 into MobAI-App:main Oct 8, 2026
1 check passed
Interlap01 pushed a commit that referenced this pull request Oct 9, 2026
On a never-booted simulator slimmed offline, disabling com.apple.assistantd
(the only vendor of com.apple.assistant.dictation) makes Spotlight's search
header loop on dictation availability and leak memory without bound
(~20-115 MB/s). Keep it enabled via the siri category's AlwaysEnabled, like
gamed in #57; re-running `simslim on` repairs devices slimmed earlier.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants