Repository navigation
[msbuild] Discard any simulators we get from devicectl in the GetAvailableDevices task. - #26576
Conversation
…lableDevices task. In Xcode 27+, `devicectl` returns simulators too. Discard any simulators we get from `devicectl` (the json output from `devicectl` doesn't contain all the information we need) that matches an existing simulator we got from `simctl`.
There was a problem hiding this comment.
🟡 Changes recommended
The new deduplication logic currently uses an O(n²) lookup pattern and lacks a regression test for the new “devicectl returns a duplicate UDID” scenario.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates the GetAvailableDevices MSBuild task to avoid duplicating simulator entries now that newer Xcodes can include simulators in devicectl output, preferring the richer simctl data when an identical UDID is already present.
Changes:
- Build the device list from
simctlfirst, then appenddevicectlresults while skipping entries whose UDID already exists. - Extend the internal
DeviceInfotype to carryUdidexplicitly so the deduplication can compare devices consistently.
File summaries
| File | Description |
|---|---|
| msbuild/Xamarin.MacDev.Tasks/Tasks/GetAvailableDevices.cs | Deduplicates devicectl results against simctl devices by UDID; plumbs UDID through DeviceInfo. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Lite
This comment has been minimized.
This comment has been minimized.
Use a hash set for UDID deduplication and add regression coverage for duplicate devicectl simulators. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Filter devicectl results against the simulator UDIDs before appending simctl results. This keeps simctl authoritative for duplicate simulator entries without changing the established physical-device-first ordering used by discarded-device results and tests.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
… the GetAvailableDevices task. (#26579) In Xcode 27+, `devicectl` returns simulators too. Discard any simulators we get from `devicectl` (the json output from `devicectl` doesn't contain all the information we need) that matches an existing simulator we got from `simctl`. Backport of #26576. --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Duplicate devicectl entries can still be retained, and the test lacks mixed-case coverage.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Resolved since last review (1)
|
does this need back port to .NET 10? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #28427e7] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 221 tests passed 🎉 Tests counts✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
…ectl in the GetAvailableDevices task. (#26828) In Xcode 27+, `devicectl` returns simulators too. Discard any simulators we get from `devicectl` (the json output from `devicectl` doesn't contain all the information we need) that matches an existing simulator we got from `simctl`. --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Alex Soto <alex@soto.dev> Backport of #26576. --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>


In Xcode 27+,
devicectlreturns simulators too. Discard any simulators we get fromdevicectl(the json output fromdevicectldoesn't contain all the information we need) that matches an existing simulator we got fromsimctl.