mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
Fix XCode simulators installation (#7769)
This commit is contained in:
committed by
GitHub
parent
5ebe1af489
commit
9f98ea4461
@@ -166,14 +166,14 @@ function Install-AdditionalSimulatorRuntimes {
|
||||
[string]$Version
|
||||
)
|
||||
|
||||
if (-not $Version.StartsWith("14.")) {
|
||||
if ($Version.Split(".")[0] -lt 14) {
|
||||
# Additional simulator runtimes are included by default for Xcode < 14
|
||||
return
|
||||
}
|
||||
|
||||
Write-Host "Installing Simulator Runtimes for Xcode $($_.link) ..."
|
||||
Write-Host "Installing Simulator Runtimes for Xcode $Version ..."
|
||||
$xcodebuildPath = Get-XcodeToolPath -Version $Version -ToolName "xcodebuild"
|
||||
Invoke-ValidateCommand "$xcodebuildPath -downloadAllPlatforms"
|
||||
Invoke-ValidateCommand "$xcodebuildPath -downloadAllPlatforms | xcpretty"
|
||||
}
|
||||
|
||||
function Build-XcodeSymlinks {
|
||||
|
||||
@@ -36,11 +36,13 @@ $xcodeVersions | ForEach-Object -ThrottleLimit $threadCount -Parallel {
|
||||
Write-Host "Configuring Xcode versions..."
|
||||
$xcodeVersions | ForEach-Object {
|
||||
Write-Host "Configuring Xcode $($_.link) ..."
|
||||
|
||||
Invoke-XcodeRunFirstLaunch -Version $_.link
|
||||
Install-AdditionalSimulatorRuntimes -Version $_.link
|
||||
}
|
||||
|
||||
$latestVersion = $xcodeVersions | Sort-Object -Property link -Descending | Select-Object -First 1 -ExpandProperty link
|
||||
Write-Host "Installing simulators for version $latestVersion..."
|
||||
Install-AdditionalSimulatorRuntimes -Version $latestVersion
|
||||
|
||||
Invoke-XcodeRunFirstLaunch -Version $defaultXcode
|
||||
|
||||
Write-Host "Configuring Xcode symlinks..."
|
||||
|
||||
@@ -98,12 +98,16 @@ Describe "Xcode simulators" {
|
||||
It "No duplicates in devices" -TestCases $testCase {
|
||||
Switch-Xcode -Version $XcodeVersion
|
||||
[array]$devicesList = @(Get-XcodeDevicesList | Where-Object { $_ })
|
||||
Write-Host "Devices for $XcodeVersion"
|
||||
Write-Host ($devicesList -join "`n")
|
||||
Validate-ArrayWithoutDuplicates $devicesList -Because "Found duplicate device simulators"
|
||||
}
|
||||
|
||||
It "No duplicates in pairs" -TestCases $testCase {
|
||||
Switch-Xcode -Version $XcodeVersion
|
||||
[array]$pairsList = @(Get-XcodePairsList | Where-Object { $_ })
|
||||
Write-Host "Pairs for $XcodeVersion"
|
||||
Write-Host ($pairsList -join "`n")
|
||||
Validate-ArrayWithoutDuplicates $pairsList -Because "Found duplicate pairs simulators"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user