fix: collapse duplicate installed runtime rows in Platforms preferences#828
Open
beforeold wants to merge 1 commit into
Open
fix: collapse duplicate installed runtime rows in Platforms preferences#828beforeold wants to merge 1 commit into
beforeold wants to merge 1 commit into
Conversation
The Platforms preferences list mapped each installed simulator runtime to every downloadable record sharing its build update. Apple's downloadable runtime index ships multiple records per build (e.g. a Universal and an Apple Silicon-only variant with the same name and buildUpdate but different identifier and architectures), so a single installed runtime was rendered as multiple rows — most visibly "iOS 26.4 Simulator Runtime" appearing twice with different sizes. Drive the list from the installed runtimes instead, collapsing to one row per installed build and preferring the downloadable variant whose architectures match what is actually installed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
The Platforms preferences screen ("Below are a list of platforms that are installed on this machine.") can show the same installed runtime more than once — most visibly "iOS 26.4 Simulator Runtime" appearing twice with two different sizes (e.g.
10.6 GBand8.46 GB), even though only one copy is installed on disk.Root cause
PlatformsListView.loadRuntimes()builds the list fromdownloadableRuntimes(Apple's downloadable-runtime index) and keeps every record whosesimulatorVersion.buildUpdatematches any installed build:Apple ships multiple downloadable records for the same build — a Universal (
arm64+x86_64) package and an Apple Silicon-only (arm64) package. They share the samenameandbuildUpdatebut differ inidentifierandarchitectures:com.apple.dmg.iPhoneSimulatorSDK26_4[arm64, x86_64]23E244com.apple.dmg.iPhoneSimulatorSDK26_4_arm64[arm64]23E244A single installed
23E244runtime matches both records, so theForEach(runtimeList, id: \.self)renders two rows (DownloadableRuntime's equality is byidentifier, so the two records are not de-duplicated). The two sizes are the two downloads' declaredfileSizevalues, not two on-disk copies.PlatformsView(the Xcode info pane) is unaffected because it filters to a single architecture variant upstream before display; the preferences list never had that de-duplication.Fix
Drive the list from the installed runtimes and collapse to one row per installed build, preferring the downloadable variant whose
architecturesmatch the installed image'ssupportedArchitectures. Deletion is unaffected — it already resolves the on-disk image by build viaRuntimeInstallationLookupService, not by the exact downloadableidentifier.Testing
Added
XcodesTests/PlatformsListViewTests.swiftcovering:Full suite passes locally:
🤖 Generated with Claude Code