Skip to content

Commit 79ec837

Browse files
authored
Merge pull request #183 from stuartisaac/main
Fix screenshot device chrome issue with Xcode 15
2 parents f5b4223 + 2bd731e commit 79ec837

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ControlRoom/Controllers/ChromeRendering/ChromeRenderer.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ class ChromeRenderer {
9898
let mainIdentifier = device.chromeIdentifier.components(separatedBy: ".").last ?? "phone"
9999

100100
// Now use that last part to find the PDFs and placement JSON.
101-
let chromePath = "\(basePath)/Chrome/\(mainIdentifier).simdevicechrome/Contents/Resources"
101+
var chromePath = "\(basePath)/Chrome/\(mainIdentifier).devicechrome/Contents/Resources"
102+
if !FileManager.default.fileExists(atPath: chromePath) {
103+
// Before Xcode 15, the path used `simdevicechrome`, not `devicechrome`, so fall back to that
104+
chromePath = "\(basePath)/Chrome/\(mainIdentifier).simdevicechrome/Contents/Resources"
105+
}
102106
baseURL = URL(filePath: chromePath)
103107

104108
let chromeURL = URL(filePath: "\(chromePath)/chrome.json")

0 commit comments

Comments
 (0)