[macOS] Fix default Xcode for docs, add after-switching warmup (#13179)

This commit is contained in:
Erik Bershel
2025-10-16 12:36:17 +02:00
committed by GitHub
parent 2f702974cc
commit 84653458a4
2 changed files with 15 additions and 4 deletions

View File

@@ -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

View File

@@ -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/