mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-24 02:18:40 +08:00
[macos] fix XCode simulator install behaviour (#7878)
* [macos] fix XCode simulator install behaviour
in 3929bc9f6e
was introduced regression: simulators were installed only for latest
XCode-14 instance. However, they should be installed for all XCode-14
instances.
let us revert that behaviour
* improve code readability by moving version comparison outside loop
* rework brew installation for ARM64
This commit is contained in:
@@ -30,11 +30,13 @@ Write-Host "Configuring Xcode versions..."
|
||||
$xcodeVersions | ForEach-Object {
|
||||
Write-Host "Configuring Xcode $($_.link) ..."
|
||||
Invoke-XcodeRunFirstLaunch -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
|
||||
if ($_.link.Split(".")[0] -ge 14) {
|
||||
# Additional simulator runtimes are included by default for Xcode < 14
|
||||
Install-AdditionalSimulatorRuntimes -Version $_.link
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Invoke-XcodeRunFirstLaunch -Version $defaultXcode
|
||||
|
||||
|
||||
Reference in New Issue
Block a user