fix(ios): exclude app extensions from physical-device process targets

Merged
PC
2d ago
+45-12

Fixes #5155

Summary

On a physical iPhone, process resolution matched every executable under the app bundle URL, so a running PlugIns/*.appex extension became a perf target alongside the app, and xctrace could attach to its pid. Only executables that sit directly in the app bundle are matched now. Other installed copies were already excluded by their container path.

close shares this lookup, so its depth-based sort is gone. One difference: if only an extension is running, close no longer kills it and treats the app as already closed.

Before / after

perf memory sample with the app (10870) and LiveActivityExtension (10844) running:

  • Before: matchedProcesses: ["App", "LiveActivityExtension"]
  • After: matchedProcesses: ["App"]

This output follows from the resolver test; it was not captured on a device.

Validation

At 939846b9a: the new regression test (second installed copy plus nested extension) fails without the source change and passes with it. The perf*, devicectl and app-launch-close tests pass (54/54); oxlint and oxfmt are clean on the changed files. No physical-device run. The --attach failure is tracked in #5154 and not addressed here.

AI assistance (Claude Code) was used to prepare this change.


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.