Skip to content

[msbuild] Discard any simulators we get from devicectl in the GetAvailableDevices task. - #26576

Open
rolfbjarne wants to merge 5 commits into
mainfrom
dev/rolf/no-sims-from-devicectl
Open

rolfbjarne wants to merge 5 commits into
mainfrom
dev/rolf/no-sims-from-devicectl

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

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.

…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`.
Copilot AI lite review requested due to automatic review settings September 8, 2026 07:06
@rolfbjarne
rolfbjarne requested a review from mauroa as a code owner September 8, 2026 07:06

Copilot AI left a comment

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.

🟡 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 simctl first, then append devicectl results while skipping entries whose UDID already exists.
  • Extend the internal DeviceInfo type to carry Udid explicitly 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

Comment thread msbuild/Xamarin.MacDev.Tasks/Tasks/GetAvailableDevices.cs Outdated
Comment thread msbuild/Xamarin.MacDev.Tasks/Tasks/GetAvailableDevices.cs Outdated
@vs-mobiletools-engineering-service2

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>

Copilot AI left a comment

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.

🟢 Approval recommended

The de-duplication logic is straightforward, matches the stated goal, and is covered by a targeted regression test.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread msbuild/Xamarin.MacDev.Tasks/Tasks/GetAvailableDevices.cs
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

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>
@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: d952a9244ea8ba55d8ea41d7e83f732e05e0e4f6 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne rolfbjarne added the ready-to-review This PR is ready to review/merge. label Sep 15, 2026
@rolfbjarne
rolfbjarne enabled auto-merge (squash) September 15, 2026 13:25
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #d952a92] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 264 tests passed 🎉

Tests counts

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 7 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 31 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 31 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 31 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 25 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 25 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 20 tests passed. [attempt 3] Html Report (VSDrops) Download
✅ monotouch (tvOS): All 25 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: d952a9244ea8ba55d8ea41d7e83f732e05e0e4f6 [PR build]

rolfbjarne added a commit that referenced this pull request Sep 16, 2026
… 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-review This PR is ready to review/merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants