Last active
March 6, 2025 04:34
-
-
Save 2Grey/0f8f90411374f0a12c64f9f705fc35c0 to your computer and use it in GitHub Desktop.
Friendly device name (Swift)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func frendlyDeviceNames(forModel model: String) -> String { | |
let frendlyNames: [String: String] = [ | |
// * Simulator | |
"i386": "Simulator", | |
"x86_64": "Simulator", | |
"arm64": "Simulator", | |
// * Apple TV | |
"AppleTV1,1": "Apple TV (1Gen)", | |
"AppleTV2,1": "Apple TV (2Gen)", | |
"AppleTV3,1": "Apple TV (3Gen)", | |
"AppleTV3,2": "Apple TV (3Gen) rev.2", | |
"AppleTV5,3": "Apple TV (4Gen)", // Also Apple TV HD | |
"AppleTV6,2": "Apple TV 4K", | |
"AppleTV11,1": "Apple TV 4K (2nd Gen)", | |
"AppleTV14,1": "Apple TV 4K (3nd Gen)", | |
// * AirPods | |
"AirPods1,1": "AirPods (1Gen)", | |
"Device1,8194": "AirPods (1Gen)", | |
"AirPods1,2": "AirPods (2Gen)", | |
"AirPods2,1": "AirPods (2Gen)", | |
"Device1,8207": "AirPods (2Gen)", | |
"AirPods1,3": "AirPods (3Gen)", | |
"Audio2,1": "AirPods (3Gen)", | |
"Device1,8211": "AirPods (3Gen)", | |
"AirPods2,2": "AirPods Pro (1Gen)", | |
"AirPodsPro1,1": "AirPods Pro(1Gen)", | |
"iProd8,1": "AirPods Pro(1Gen)", | |
"Device1,8206": "AirPods Pro(1Gen)", | |
"AirPodsPro1,2": "AirPods Pro (2Gen)", | |
"AirPods3,1": "AirPods Pro (2Gen)", | |
"Device1,8212": "AirPods Pro (2Gen)", | |
"Device1,8228": "AirPods Pro (2Gen, USB-C)", | |
"AirPodsMax1,1": "AirPods Max", | |
"iProd8,6": "AirPods Max", | |
"Device1,8202": "AirPods Max", | |
"AirPods1,4": "AirPods 4", | |
"AirPodsMax1,2": "AirPods Max with USB-C", | |
"Device1,8223": "AirPods Max with USB-C", | |
// * AirTag | |
"AirTag1,1": "AirTag", | |
// * HomePod | |
"AudioAccessory1,1": "HomePod (1Gen)", | |
"AudioAccessory1,2": "HomePod (1Gen)", | |
"AudioAccessory5,1": "HomePod mini", | |
"AudioAccessorySingle5,1": "HomePod mini", | |
"AudioAccessory6,1": "HomePod (2Gen)", | |
// * Vision Pro | |
"RealityDevice14,1": "Vision Pro", | |
// * Apple Watch | |
"Watch1,1": "Apple Watch (38mm)", | |
"Watch1,2": "Apple Watch (42mm)", | |
"Watch2,3": "Apple Watch Series 2 (38mm)", | |
"Watch2,4": "Apple Watch Series 2 (42mm)", | |
"Watch2,6": "Apple Watch Series 1 (38mm)", | |
"Watch2,7": "Apple Watch Series 1 (42mm)", | |
"Watch3,1": "Apple Watch Series 3 (38mm Cellular)", | |
"Watch3,2": "Apple Watch Series 3 (42mm Cellular)", | |
"Watch3,3": "Apple Watch Series 3 (38mm)", | |
"Watch3,4": "Apple Watch Series 3 (42mm)", | |
"Watch4,1": "Apple Watch Series 4 (40mm)", | |
"Watch4,2": "Apple Watch Series 4 (44mm)", | |
"Watch4,3": "Apple Watch Series 4 (40mm Cellular)", | |
"Watch4,4": "Apple Watch Series 4 (44mm Cellular)", | |
"Watch5,1": "Apple Watch Series 5 (40mm ,GPS)", | |
"Watch5,2": "Apple Watch Series 5 (44mm, GPS)", | |
"Watch5,3": "Apple Watch Series 5 (40mm, Cellular)", | |
"Watch5,4": "Apple Watch Series 5 (44mm, Cellular)", | |
"Watch5,9": "Apple Watch SE (40mm, GPS)", | |
"Watch5,10": "Apple Watch SE (44mm, GPS)", | |
"Watch5,11": "Apple Watch SE (40mm, Cellular)", | |
"Watch5,12": "Apple Watch SE (44mm, Cellular)", | |
"Watch6,1": "Apple Watch Series 6 (40mm, GPS)", | |
"Watch6,2": "Apple Watch Series 6 (44mm, GPS)", | |
"Watch6,3": "Apple Watch Series 6 (40mm, Cellular)", | |
"Watch6,4": "Apple Watch Series 6 (44mm, Cellular)", | |
"Watch6,6": "Apple Watch Series 7 (40mm, GPS)", | |
"Watch6,7": "Apple Watch Series 7 (44mm, GPS)", | |
"Watch6,8": "Apple Watch Series 7 (40mm, Cellular)", | |
"Watch6,9": "Apple Watch Series 7 (44mm, Cellular)", | |
"Watch6,10": "Apple Watch SE 2nd Gen (40mm)", | |
"Watch6,11": "Apple Watch SE 2nd Gen (44mm)", | |
"Watch6,12": "Apple Watch SE 2nd Gen (40mm Cellular)", | |
"Watch6,13": "Apple Watch SE 2nd Gen (44mm Cellular)", | |
"Watch6,14": "Apple Watch Series 8 (41mm)", | |
"Watch6,15": "Apple Watch Series 8 (45mm) ", | |
"Watch6,16": "Apple Watch Series 8 (41mm Cellular)", | |
"Watch6,17": "Apple Watch Series 8 (45mm Cellular)", | |
"Watch6,18": "Apple Watch Ultra", | |
"Watch7,1": "Apple Watch Series 9 (41mm)", | |
"Watch7,2": "Apple Watch Series 9 (45mm)", | |
"Watch7,3": "Apple Watch Series 9 (41mm Cellular)", | |
"Watch7,4": "Apple Watch Series 9 (45mm Cellular)", | |
"Watch7,5": "Apple Watch Ultra 2", | |
"Watch7,8": "Apple Watch Series 10 (42mm)", | |
"Watch7,9": "Apple Watch Series 10 (46mm)", | |
"Watch7,10": "Apple Watch Series 10 (42mm Cellular)", | |
"Watch7,11": "Apple Watch Series 10 (46mm Cellular)", | |
// * iPhone | |
"iPhone1,1": "iPhone 1G", | |
"iPhone1,2": "iPhone 3G", | |
"iPhone2,1": "iPhone 3GS", | |
"iPhone3,1": "iPhone 4 (GSM)", | |
"iPhone3,2": "iPhone 4 (GSM / 2012)", | |
"iPhone3,3": "iPhone 4 (CDMA)", | |
"iPhone4,1": "iPhone 4S", | |
"iPhone5,1": "iPhone 5 (GSM)", | |
"iPhone5,2": "iPhone 5 (Global)", | |
"iPhone5,3": "iPhone 5C (GSM)", | |
"iPhone5,4": "iPhone 5C (Global)", | |
"iPhone6,1": "iPhone 5S (GSM)", | |
"iPhone6,2": "iPhone 5S (Global)", | |
"iPhone7,1": "iPhone 6 Plus", | |
"iPhone7,2": "iPhone 6", | |
"iPhone8,1": "iPhone 6S", | |
"iPhone8,2": "iPhone 6S Plus", | |
"iPhone8,4": "iPhone SE", | |
"iPhone9,1": "iPhone 7 (Global)", | |
"iPhone9,2": "iPhone 7 Plus (Global)", | |
"iPhone9,3": "iPhone 7 (GSM)", | |
"iPhone9,4": "iPhone 7 Plus (GSM)", | |
"iPhone10,1": "iPhone 8 (Global)", | |
"iPhone10,2": "iPhone 8 Plus (Global)", | |
"iPhone10,3": "iPhone X (Global)", | |
"iPhone10,4": "iPhone 8 (GSM)", | |
"iPhone10,5": "iPhone 8 Plus (GSM)", | |
"iPhone10,6": "iPhone X (GSM)", | |
"iPhone11,2": "iPhone XS", | |
"iPhone11,4": "iPhone XS Max", | |
"iPhone11,6": "iPhone XS Max (China)", | |
"iPhone11,8": "iPhone XR", | |
"iPhone12,1": "iPhone 11", | |
"iPhone12,3": "iPhone 11 Pro", | |
"iPhone12,5": "iPhone 11 Pro Max", | |
"iPhone12,8": "iPhone SE (2nd generation)", | |
"iPhone13,1": "iPhone 12 mini", | |
"iPhone13,2": "iPhone 12", | |
"iPhone13,3": "iPhone 12 Pro", | |
"iPhone13,4": "iPhone 12 Pro Max", | |
"iPhone14,2": "iPhone 13 Pro", | |
"iPhone14,3": "iPhone 13 Pro Max", | |
"iPhone14,4": "iPhone 13 mini", | |
"iPhone14,5": "iPhone 13", | |
"iPhone14,6": "iPhone SE (3rd generation)", | |
"iPhone14,7": "iPhone 14", | |
"iPhone14,8": "iPhone 14 Plus", | |
"iPhone15,2": "iPhone 14 Pro", | |
"iPhone15,3": "iPhone 14 Pro Max", | |
"iPhone15,4": "iPhone 15", | |
"iPhone15,5": "iPhone 15 Plus", | |
"iPhone16,1": "iPhone 15 Pro", | |
"iPhone16,2": "iPhone 15 Pro Max", | |
"iPhone17,1": "iPhone 16 Pro", | |
"iPhone17,2": "iPhone 16 Pro Max", | |
"iPhone17,3": "iPhone 16", | |
"iPhone17,4": "iPhone 16 Plus", | |
"iPhone17,5": "iPhone 16e", | |
// * iPod | |
"iPod1,1": "iPod touch (1st generation)", | |
"iPod2,1": "iPod touch (2nd generation)", | |
"iPod3,1": "iPod touch (3rd generation)", | |
"iPod4,1": "iPod touch (4th generation)", | |
"iPod5,1": "iPod touch (5th generation)", | |
"iPod7,1": "iPod touch (6th generation)", | |
"iPod9,1": "iPod touch (7th generation)", | |
// * iPad | |
"iPad1,1": "iPad", | |
"iPad1,2": "iPad 3G", | |
"iPad2,1": "iPad 2 (WiFi)", | |
"iPad2,2": "iPad 2 (GSM)", | |
"iPad2,3": "iPad 2 CDMA", | |
"iPad2,4": "iPad 2 (CDMA / 2012)", | |
"iPad3,1": "iPad 3 (WiFi)", | |
"iPad3,2": "iPad 3 (CDMA)", | |
"iPad3,3": "iPad 3 (GSM)", | |
"iPad3,4": "iPad 4 (WiFi)", | |
"iPad3,5": "iPad 4 (GSM)", | |
"iPad3,6": "iPad 4 (Global)", | |
"iPad6,11": "iPad 9.7\" 5th Gen (Wi-Fi)", | |
"iPad6,12": "iPad 9.7\" 5th Gen (Cellular)", | |
"iPad7,5": "iPad 9.7\" 6th Gen (Wi-Fi)", | |
"iPad7,6": "iPad 9.7\" 6th Gen (Cellular)", | |
"iPad7,11": "iPad 10.2\" 7th Gen (Wi-Fi)", | |
"iPad7,12": "iPad 10.2\" 7th Gen (Cellular)", | |
"iPad11,6": "iPad 10.2\" 8th Gen (Wi-Fi)", | |
"iPad11,7": "iPad 10.2\" 8th Gen (Cellular)", | |
"iPad12,1": "iPad 10.2\" 9th Gen (Wi-Fi)", | |
"iPad12,2": "iPad 10.2\" 9th Gen (Cellular)", | |
"iPad13,18": "iPad 10.9\" 10th Gen (Wi-Fi)", | |
"iPad13,19": "iPad 10.9\" 10th Gen (Cellular)", | |
"iPad15,7": "iPad (A16)", | |
"iPad15,8": "iPad (A16)", | |
// * iPad Air | |
"iPad4,1": "iPad Air (WiFi)", | |
"iPad4,2": "iPad Air (Cellular)", | |
"iPad4,3": "iPad Air (Cellular China)", | |
"iPad5,3": "iPad Air 2 (WiFi)", | |
"iPad5,4": "iPad Air 2 (Cellular)", | |
"iPad11,3": "iPad Air 3 (Wi-Fi)", | |
"iPad11,4": "iPad Air 3 (Cellular)", | |
"iPad13,1": "iPad Air 4 (Wi-Fi)", | |
"iPad13,2": "iPad Air 4 (Cellular)", | |
"iPad13,16": "iPad Air 5 (Wi-Fi)", | |
"iPad13,17": "iPad Air 5 (Cellular)", | |
"iPad14,8": "iPad Air M2 11\" (WiFi)", | |
"iPad14,9": "iPad Air M2 11\" (Cellular)", | |
"iPad14,10": "iPad Air M2 13\" (WiFi)", | |
"iPad14,11": "iPad Air M2 13\" (Cellular)", | |
"iPad15,3": "iPad Air 11-inch (M3)", | |
"iPad15,4": "iPad Air 11-inch (M3)", | |
"iPad15,5": "iPad Air 13-inch (M3)", | |
"iPad15,6": "iPad Air 13-inch (M3)", | |
// * iPad Pro | |
"iPad6,3": "iPad Pro 9.7\" (Wi-Fi)", | |
"iPad6,4": "iPad Pro 9.7\" (Cellular)", | |
"iPad6,7": "iPad Pro 12.9\" (Wi-Fi)", | |
"iPad6,8": "iPad Pro 12.9\" (Cellular)", | |
"iPad7,1": "iPad Pro 2 12.9\" (WiFi)", | |
"iPad7,2": "iPad Pro 2 12.9\" (Cellular)", | |
"iPad7,3": "iPad Pro 10.5\" (WiFi)", | |
"iPad7,4": "iPad Pro 10.5\" (Cellular)", | |
"iPad8,1": "iPad Pro 11\" (Wi-Fi)", | |
"iPad8,2": "iPad Pro 11\" (Wi-Fi)", | |
"iPad8,3": "iPad Pro 11\" (Cellular)", | |
"iPad8,4": "iPad Pro 11\" (Cellular)", | |
"iPad8,5": "iPad Pro 12.9\" 3rd Gen (Wi-Fi)", | |
"iPad8,6": "iPad Pro 12.9\" 3rd Gen (Wi-Fi)", | |
"iPad8,7": "iPad Pro 12.9\" 3rd Gen (Cellular)", | |
"iPad8,8": "iPad Pro 12.9\" 3rd Gen (Cellular)", | |
"iPad8,9": "iPad Pro 11\" 2nd Gen (Wi-Fi)", | |
"iPad8,10": "iPad Pro 11\" 2nd Gen (Cellular)", | |
"iPad8,11": "iPad Pro 12.9\" 4th Gen (Wi-Fi)", | |
"iPad8,12": "iPad Pro 12.9\" 4th Gen (Cellular)", | |
"iPad13,4": "iPad Pro 11\" 3rd Gen", | |
"iPad13,5": "iPad Pro 11\" 3rd Gen", | |
"iPad13,6": "iPad Pro 11\" 3rd Gen", | |
"iPad13,7": "iPad Pro 11\" 3rd Gen", | |
"iPad13,8": "iPad Pro 12.9\" 5th Gen (Wi-Fi)", | |
"iPad13,9": "iPad Pro 12.9\" 5th Gen (Wi-Fi)", | |
"iPad13,10": "iPad Pro 12.9\" 5th Gen (Cellular)", | |
"iPad13,11": "iPad Pro 12.9\" 5th Gen (Cellular China)", | |
"iPad14,3": "iPad Pro 11\" 4th Gen (WiFi)", | |
"iPad14,4": "iPad Pro 11\" 4th Gen (Cellular)", | |
"iPad14,5": "iPad Pro 12.9\" (WiFi)", | |
"iPad14,6": "iPad Pro 12.9\" (Cellular)", | |
"iPad16,3": "iPad Pro M4 11\" (WiFi)", | |
"iPad16,4": "iPad Pro M4 11\" (Cellular)", | |
"iPad16,5": "iPad Pro M4 13\" (WiFi)", | |
"iPad16,6": "iPad Pro M4 13\" (Cellular)", | |
// * iPad Mini | |
"iPad2,5": "iPad Mini (WiFi)", | |
"iPad2,6": "iPad Mini (GSM)", | |
"iPad2,7": "iPad Mini (Global)", | |
"iPad4,4": "iPad Mini 2 (WiFi)", | |
"iPad4,5": "iPad Mini 2 (Cellular)", | |
"iPad4,6": "iPad Mini 2 (Cellular China)", | |
"iPad4,7": "iPad Mini 3 (WiFi)", | |
"iPad4,8": "iPad Mini 3 (Cellular)", | |
"iPad4,9": "iPad Mini 3 (Cellular China)", | |
"iPad5,1": "iPad mini 4 (Wi-Fi)", | |
"iPad5,2": "iPad mini 4 (Cellular)", | |
"iPad11,1": "iPad mini 5 (Wi-Fi)", | |
"iPad11,2": "iPad mini 5 (Cellular)", | |
"iPad14,1": "iPad mini 6 (Wi-Fi)", | |
"iPad14,2": "iPad mini 6 (Cellular)", | |
] | |
return frendlyNames[model] ?? model | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment