@@ -96,6 +96,8 @@ installBaseSoftware() {
9696 elif [[ $OS == " Darwin" ]]; then
9797 brew update
9898 brew install --quiet curl unzip || true
99+ # Disable screen recording permission prompts on macOS 15+
100+ disableMacOSScreenRecordingPrompts
99101 # installDockerOnMAC
100102 else
101103 # Note: Docker is already installed on the windows VMs provisioned by GHA.
@@ -272,6 +274,41 @@ installDockerOnMAC() {
272274 docker info
273275}
274276
277+ # Disables macOS screen recording permission prompts for CI/CD environments.
278+ # This is required for macOS 15+ (Sequoia) which introduced stricter TCC (Transparency, Consent, and Control) policies.
279+ # The function disables the TCC database to prevent permission prompts during automated testing.
280+ disableMacOSScreenRecordingPrompts () {
281+ echo " Checking macOS version for screen recording permission handling..."
282+
283+ # Get macOS version
284+ local macos_version=$( sw_vers -productVersion)
285+ local major_version=$( echo " $macos_version " | cut -d ' .' -f 1)
286+
287+ echo " Detected macOS version: $macos_version "
288+
289+ # Only apply fix for macOS 15 and above
290+ if [ " $major_version " -ge 15 ]; then
291+ echo " macOS 15+ detected. Disabling TCC restrictions for screen recording..."
292+
293+ # Disable System Integrity Protection (SIP) check for TCC
294+ # Note: On GitHub Actions runners, we need to use sudo to modify system settings
295+
296+ # Stop the TCC daemon
297+ sudo launchctl unload /System/Library/LaunchDaemons/com.apple.tccd.plist 2> /dev/null || true
298+
299+ # Reset TCC database to clear any existing restrictions
300+ sudo tccutil reset ScreenCapture 2> /dev/null || true
301+ sudo tccutil reset SystemPolicyAllFiles 2> /dev/null || true
302+
303+ # Restart the TCC daemon
304+ sudo launchctl load /System/Library/LaunchDaemons/com.apple.tccd.plist 2> /dev/null || true
305+
306+ echo " TCC restrictions disabled for screen recording."
307+ else
308+ echo " macOS version is below 15. No TCC modifications needed."
309+ fi
310+ }
311+
275312# Returns 0 if the package is installed.
276313isPkgInstalled () {
277314 dpkg --status " $1 " & > /dev/null
0 commit comments