Skip to content

Commit c866e4c

Browse files
rmarinhorolfbjarne
andauthored
[ci] Try better fix for iOS simulator (#32108)
* tweak * delete all simulator runtimes if failing to install one --------- Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
1 parent a4c1246 commit c866e4c

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

eng/pipelines/common/provision.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,27 @@ steps:
8686
xcrun xcode-select --print-path
8787
xcodebuild -version
8888
sudo xcodebuild -license accept
89-
sudo xcodebuild -downloadPlatform iOS -buildVersion 26.0 -architectureVariant universal
89+
# if we're using Xcode 26.0[.?], then explicitly install the iOS 26.0 simulator (the iOS 26.0.1 simulator doesn't work for us)
90+
# also install the universal simulator version, so that this bot can run x64 apps in the simulator.
91+
if [[ "$(REQUIRED_XCODE)" =~ ^26[.]0.*$ ]]; then
92+
if ! sudo xcodebuild -downloadPlatform iOS -architectureVariant universal -buildVersion 26.0; then
93+
echo "Failed to install simulator runtime, deleting all simulator runtimes and trying again..."
94+
sudo xcrun simctl runtime delete all
95+
# simulator runtimes are deleted asynchronously, so wait until they're all gone (but max 60 seconds)
96+
for i in $(seq 1 60); do
97+
sleep 1
98+
C=$(xcrun simctl runtime list -j | jq '. | length')
99+
if [[ $C == 0 ]]; then
100+
echo " still $C simulators left..."
101+
break
102+
fi
103+
done
104+
echo "Re-trying simulator runtime installation"
105+
sudo xcodebuild -downloadPlatform iOS -architectureVariant universal -buildVersion 26.0
106+
fi
107+
else
108+
sudo xcodebuild -downloadPlatform iOS -architectureVariant universal
109+
fi
90110
sudo xcodebuild -runFirstLaunch
91111
displayName: Select Xcode Version
92112
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))

0 commit comments

Comments
 (0)