fix(app-management): use simctl --json instead of a shell pipe for simulator app list - #486
Closed
Mochxd wants to merge 1 commit into
Closed
fix(app-management): use simctl --json instead of a shell pipe for simulator app list#486Mochxd wants to merge 1 commit into
Mochxd wants to merge 1 commit into
Conversation
KazuCocoa
reviewed
Aug 12, 2026
| '-', | ||
| '-', | ||
| ]); | ||
| const {stdout} = await exec('xcrun', ['simctl', 'listapps', udid, '--json']); |
Member
There was a problem hiding this comment.
We want to call the simctl via https://appium.github.io/appium-xcuitest-driver/12.3/reference/execute-methods/#mobile-simctl instead of direct simctl to make the same logic work on local/remote.
Let me do the update instead
Member
There was a problem hiding this comment.
Btw, did you succeed in getting JSON format with this...? My local didn't return valid JSON with the --json such as xcrun simctl listapps C874BE6A-7424-4493-AAFB-3BE54C3942AE --json (vanilla xcrun as well)
#487 instead which worked on my local
Merged
Member
|
Let me merge #487 as the json format didn't work expectedly on my env even vanilla |
Member
|
thank you for the finding |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Listing apps on an iOS simulator passes a shell pipe as
spawnarguments:teen_process.execspawns without a shell, so|,plutiland the rest are handed tosimctl listappsas literal arguments instead of forming a pipeline. The simulator app list never gets converted to JSON, soappium_app_lifecycle action=listand name-based app resolution fail on local simulator sessions.This regressed in #423, which converted the original
child_process.execshell string (xcrun simctl listapps "$udid" | plutil -convert json -o - -) into an argv array. The pipe was preserved as an argument.Fix
Ask
simctlfor JSON directly with--json, which is whatprepare-ios-simulator.tsalready does when it reads the simulator app list:https://github.com/appium/appium-mcp/blob/main/src/tools/ios/prepare-ios-simulator.ts#L180
This drops the
plutildependency entirely and keeps the two simulator code paths consistent.Test
Added
src/tests/tools/app-management/list-apps.test.tscovering the simulator branch:simctlis invoked as['simctl', 'listapps', udid, '--json'], with no|orplutilargument