From 2bd731edaf3f7ba93986f8d2ecd5387a3ee7342b Mon Sep 17 00:00:00 2001 From: Stuart Isaac Date: Wed, 20 Dec 2023 15:40:13 -0600 Subject: [PATCH] Fix screenshot device chrome issue with Xcode 15 --- .../Controllers/ChromeRendering/ChromeRenderer.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ControlRoom/Controllers/ChromeRendering/ChromeRenderer.swift b/ControlRoom/Controllers/ChromeRendering/ChromeRenderer.swift index 6d4332d..131740d 100644 --- a/ControlRoom/Controllers/ChromeRendering/ChromeRenderer.swift +++ b/ControlRoom/Controllers/ChromeRendering/ChromeRenderer.swift @@ -98,7 +98,11 @@ class ChromeRenderer { let mainIdentifier = device.chromeIdentifier.components(separatedBy: ".").last ?? "phone" // Now use that last part to find the PDFs and placement JSON. - let chromePath = "\(basePath)/Chrome/\(mainIdentifier).simdevicechrome/Contents/Resources" + var chromePath = "\(basePath)/Chrome/\(mainIdentifier).devicechrome/Contents/Resources" + if !FileManager.default.fileExists(atPath: chromePath) { + // Before Xcode 15, the path used `simdevicechrome`, not `devicechrome`, so fall back to that + chromePath = "\(basePath)/Chrome/\(mainIdentifier).simdevicechrome/Contents/Resources" + } baseURL = URL(filePath: chromePath) let chromeURL = URL(filePath: "\(chromePath)/chrome.json")