diff --git a/SBTUITunnelHostServer/Sources/SimulatorDescriptor.swift b/SBTUITunnelHostServer/Sources/SimulatorDescriptor.swift index 5d21562..28b41ab 100644 --- a/SBTUITunnelHostServer/Sources/SimulatorDescriptor.swift +++ b/SBTUITunnelHostServer/Sources/SimulatorDescriptor.swift @@ -15,9 +15,11 @@ enum SimulatorDescriptor { case .byDeviceNameAndRuntime(let deviceName, var runtime): runtime = runtime.components(separatedBy: ".").prefix(2).joined(separator: ".") // 11.1.1 -> 11.1 let escapedDeviceName = NSRegularExpression.escapedPattern(for: deviceName) - let regex = "\(escapedDeviceName) (-|—) (iOS )?\(runtime)(\\.\\d)?" + let regex = "\(escapedDeviceName)( (-|—) (iOS )?\(runtime)(\\.\\d)?)?" + + let found = windowName.range(of: regex, options: .regularExpression, range: nil, locale: nil) != nil - return windowName.range(of: regex, options: .regularExpression, range: nil, locale: nil) != nil + return found } } }