From 84653458a411b3c25da0047aa3a1ab100e11cd27 Mon Sep 17 00:00:00 2001 From: Erik Bershel <110455084+erik-bershel@users.noreply.github.com> Date: Thu, 16 Oct 2025 12:36:17 +0200 Subject: [PATCH] [macOS] Fix default Xcode for docs, add after-switching warmup (#13179) --- .../scripts/build/Configure-Xcode-Simulators.ps1 | 13 +++++++++---- images/macos/scripts/build/configure-system.sh | 6 ++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/images/macos/scripts/build/Configure-Xcode-Simulators.ps1 b/images/macos/scripts/build/Configure-Xcode-Simulators.ps1 index d4bcd8cb7..3e2791e92 100644 --- a/images/macos/scripts/build/Configure-Xcode-Simulators.ps1 +++ b/images/macos/scripts/build/Configure-Xcode-Simulators.ps1 @@ -8,10 +8,11 @@ Import-Module "~/image-generation/helpers/Common.Helpers.psm1" Import-Module "~/image-generation/helpers/Xcode.Helpers.psm1" $arch = Get-Architecture $xcodeVersions = (Get-ToolsetContent).xcode.${arch}.versions +$defaultXcode = (Get-ToolsetContent).xcode.default # Switch to each Xcode version foreach ($xcodeVersion in $xcodeVersions.link) { - write-host "Switching to Xcode $xcodeVersion" + Write-Host "Switching to Xcode $xcodeVersion" Switch-Xcode -Version $XcodeVersion # Make object of all simulators @@ -50,8 +51,8 @@ foreach ($xcodeVersion in $xcodeVersions.link) { Write-Host "$($sameRuntimeDevices[$i+1].DeviceName) - DeviceId $($sameRuntimeDevices[$i+1].DeviceId)" Write-Host "-------------------------------------------------------------------" if ($sameRuntimeDevices[$i].DeviceName -eq $sameRuntimeDevices[$i+1].DeviceName) { - write-host "*******************************************************************" - write-host "** Duplicate found" + Write-Host "*******************************************************************" + Write-Host "** Duplicate found" if ($sameRuntimeDevices[$i].DeviceCreationTime -lt $sameRuntimeDevices[$i+1].DeviceCreationTime) { Write-Host "** will be removed $($sameRuntimeDevices[$i+1].DeviceName) with id $($sameRuntimeDevices[$i+1].DeviceId)" xcrun simctl delete $sameRuntimeDevices[$i+1].DeviceId @@ -61,8 +62,12 @@ foreach ($xcodeVersion in $xcodeVersions.link) { xcrun simctl delete $sameRuntimeDevices[$i].DeviceId $sameRuntimeDevices.RemoveAt($i) } - write-host "*******************************************************************" + Write-Host "*******************************************************************" } } } } + +# Restore default Xcode +Write-Host "Restoring default Xcode to $defaultXcode" +Switch-Xcode -Version $defaultXcode diff --git a/images/macos/scripts/build/configure-system.sh b/images/macos/scripts/build/configure-system.sh index d88972135..8cbf3d680 100644 --- a/images/macos/scripts/build/configure-system.sh +++ b/images/macos/scripts/build/configure-system.sh @@ -40,6 +40,12 @@ if is_SonomaX64 || is_VenturaX64 || is_SequoiaX64; then brew uninstall parallels fi +# Simple warmup of the default Xcode +echo "Warm up the default Xcode" +xcodebuild -version > /dev/null +xcrun simctl list > /dev/null +xcrun simctl list devices > /dev/null + echo "Put documentation to $HOME root" cp $HOME/image-generation/output/software-report/systeminfo.* $HOME/