@@ -26,49 +26,6 @@ function Get-AndroidEmulatorId
2626 }
2727}
2828
29- # mlaunch (inside xharness) checks if simulator watchdogs are disabled before
30- # launching an app. If not, it shuts down the sim, writes plist files, then
31- # reboots via Simulator.app — but simctl still sees it as Shutdown, so the
32- # launch fails. The CI log sequence:
33- #
34- # dbug: Xamarin.Hosting: Simulator watchdogs are not disabled for 'iPhone 17 (...)'
35- # dbug: Xamarin.Hosting: Shutting down simulator...
36- # dbug: Xamarin.Hosting: Successfully disabled simulator watchdogs for 'iPhone 17 (...)'
37- # dbug: Xamarin.Hosting: Launching simulator application 'com.apple.iphonesimulator'
38- # dbug: Xamarin.Hosting: Ready notification 'com.apple.iphonesimulator.ready' received from the simulator.
39- # dbug: Unable to lookup in current state: Shutdown
40- # dbug: error HE0042: Could not launch the app '...' on the device '...': simctl returned exit code 149
41- # dbug: Process mlaunch exited with 1
42- #
43- # By pre-writing the watchdog plists before booting, mlaunch sees watchdogs
44- # already disabled and skips its shutdown/reboot dance entirely.
45- function Disable-IosSimulatorWatchdogs {
46- param (
47- [Parameter (Mandatory )]
48- [string ]$Udid
49- )
50- $prefsPath = " $HOME /Library/Developer/CoreSimulator/Devices/$Udid /data/Library/Preferences"
51- New-Item - ItemType Directory - Force - Path $prefsPath | Out-Null
52- $keys = @ (
53- ' FBLaunchWatchdogScale' ,
54- ' FBLaunchWatchdogFirstPartyScale' ,
55- ' FBLaunchWatchdogResumeScale' ,
56- ' FBLaunchWatchdogScaleOverride' ,
57- ' FBLaunchWatchdogFirstPartyScaleOverride' ,
58- ' FBLaunchWatchdogResumeScaleOverride'
59- )
60- foreach ($plist in @ (' com.apple.springboard.plist' , ' com.apple.frontboard.plist' )) {
61- $plistPath = " $prefsPath /$plist "
62- if (-not (Test-Path $plistPath )) {
63- / usr/ bin/ plutil - create xml1 $plistPath
64- }
65- foreach ($key in $keys ) {
66- / usr/ libexec/ PlistBuddy - c " Delete :$key " $plistPath 2>&1 | Out-Null
67- / usr/ libexec/ PlistBuddy - c " Add :$key real 100" $plistPath
68- }
69- }
70- }
71-
7229function Get-IosSimulatorUdid {
7330 [CmdletBinding ()]
7431 param (
0 commit comments