diff --git a/Source/Device.swift b/Source/Device.swift index 2126c142..7501c97b 100644 --- a/Source/Device.swift +++ b/Source/Device.swift @@ -239,15 +239,17 @@ public enum Device { case "iPad5,1", "iPad5,2": return iPadMini4 case "iPad6,3", "iPad6,4": return iPadPro9Inch case "iPad6,7", "iPad6,8": return iPadPro12Inch - // swiftlint:disable:next force_unwrapping - case "i386", "x86_64": return simulator(mapToDevice(identifier: String(validatingUTF8: getenv("SIMULATOR_MODEL_IDENTIFIER"))!)) + case "i386", "x86_64": return simulator(mapToDevice( + identifier: ProcessInfo().environment["SIMULATOR_MODEL_IDENTIFIER"] ?? "iOS" + )) default: return unknown(identifier) } #elseif os(tvOS) switch identifier { case "AppleTV5,3": return appleTV4 - // swiftlint:disable:next force_unwrapping - case "i386", "x86_64": return simulator(mapToDevice(identifier: String(validatingUTF8: getenv("SIMULATOR_MODEL_IDENTIFIER"))!)) + case "i386", "x86_64": return simulator(mapToDevice( + identifier: ProcessInfo().environment["SIMULATOR_MODEL_IDENTIFIER"] ?? "tvOS" + )) default: return unknown(identifier) } #endif