Skip to content

Commit

Permalink
Support simulator window name changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tcamin committed Dec 29, 2022
1 parent e15832a commit c0ab0a0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions SBTUITunnelHostServer/Sources/SimulatorDescriptor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
Expand Down

0 comments on commit c0ab0a0

Please sign in to comment.