Skip to content
This repository was archived by the owner on Oct 2, 2026. It is now read-only.

fix: Find app processes on Xcode 27 in terminateApp - #35

Merged
mykola-mokhnach merged 2 commits into
appium:mainfrom
vmanapat:fix/executable-path-filter-xcode-27
Oct 2, 2026
Merged

mykola-mokhnach merged 2 commits into
appium:mainfrom
vmanapat:fix/executable-path-filter-xcode-27

Conversation

@vmanapat

@vmanapat vmanapat commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

On Xcode 27, devicectl no longer accepts executable.path as a process filter, so terminateApp fails straight away:

ERROR: Unknown filter field 'executable.path'. Did you mean 'Executable Path'? (com.apple.dt.CoreDeviceError error 28001)

Written as one word, ExecutablePath works on Xcode 27. This reads info.jsonVersion from devicectl once per instance and filters on ExecutablePath when it is 5 or higher, and on executable.path otherwise.

Xcode 15.0 through 26.6 on GitHub's macOS runners report JSON version 2 or 3; Xcode 27.0 reports 5.

Tested on Xcode 27.0 with a physical iPhone: terminateApp returns true for a running app and false once it is closed. The path for older Xcode is covered by unit tests only because I no longer have Xcode 26.

@linux-foundation-easycla

linux-foundation-easycla Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: vmanapat / name: Vincent Manapat (02e152e)

Comment thread lib/mixins/process.ts Outdated
}

const EXECUTABLE_PATH_FILTER_FIELDS = ['ExecutablePath', 'executable.path'] as const;
const UNKNOWN_FILTER_FIELD_ERROR = /CoreDeviceError error 28001\b|Unknown filter field/;

@mykola-mokhnach mykola-mokhnach Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checking the error message does not look like a reliable pattern to me. Can we instead verify the tool version? also the version itself could be memoized, since it's not going to change after an instance has been created

@mykola-mokhnach mykola-mokhnach Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it would even be more precise to use info.jsonVersion field (in Xcode 27 it equals to 5) for this purpose rather than devicectl version.

xCode release notes for v27 ( https://developer.apple.com/documentation/xcode-release-notes/xcode-27-release-notes.md ) mentions "Fixed issues where passing a key path to a --filter flag would fail to find matches or just return an error," FB176141854/183772989

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that is a better approach. I've switched to info.jsonVersion and dropped the error matching.

To check the threshold I ran devicectl --version and devicectl list devices --json-output for every Xcode installed on GitHub's hosted macOS runners:

Runner Xcode versions devicectl version jsonVersion
macos-14 15.0.1 to 16.2 397.28 2
macos-15 16.0 to 26.3 506.7 3
macos-26 26.0.1 to 26.6 518.33 3
my Mac 27.0 642.16 5

Two things I took from that:

  • Everything before Xcode 27 reports 2 or 3, so >= 5 separates them cleanly.
  • jsonVersion seems more straightforward.

terminateApp no longer tries ExecutablePath and falls back to
executable.path when devicectl rejects it with error 28001. It reads
info.jsonVersion once per instance and filters on ExecutablePath from
version 5 (Xcode 27), and on executable.path before that.

Xcode 15.0 through 26.6 on GitHub's macOS runners report JSON version
2 or 3; Xcode 27.0 reports 5.
@mykola-mokhnach
mykola-mokhnach merged commit 7b7befa into appium:main Oct 2, 2026
6 checks passed
github-actions Bot pushed a commit that referenced this pull request Oct 2, 2026
## [2.1.1](v2.1.0...v2.1.1) (2026-10-02)

### Bug Fixes

* Find app processes on Xcode 27 in terminateApp ([#35](#35)) ([7b7befa](7b7befa))
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants