iPhone 6 和 6 Plus 的平台字符串是什么?
仅供参考:平台字符串很重要,因为它有助于识别用于编程目的的硬件模型。
以下是我的猜测:
- iPhone 6 (GSM): iPhone7,1
- iPhone 6(全球):iPhone7,2
- iPhone 6 Plus (GSM):iPhone7,3
- iPhone 6 Plus(全球):iPhone7,4
更新:我的公司现在有一个 verizon iPhone 6 和 6 Plus,这就是我发现的
下面的旧答案供后人参考。
所以我在iOS 8 的 IPSW 文件中做了一些研究。2 个 iPhone 6 型号有 2 个文件;iPhone7,1 和 iPhone7,2。iPhone7,2 IPSW 文件包含一个名为 kernelcache.release.n61 的文件,而 N61 是 iPhone 6 的内部名称。同样,iPhone7,1 的 IPSW 文件包含一个 kernelcache.release.n56 文件,N56 是 iPhone 6加。此外,iPhone7,1 固件包含@3x 图像资源,iPhone7,2 固件包含@2x 资源。
所以:
这两种设备似乎没有任何变体。
新 iPhone 6、6s、6 Plus 和 6s Plus 的平台字符串:
此外,这是从一开始就包含所有平台字符串的片段:
if ([platform isEqualToString:@"iPhone1,1"]) return @"iPhone 2G";
if ([platform isEqualToString:@"iPhone1,2"]) return @"iPhone 3G";
if ([platform isEqualToString:@"iPhone2,1"]) return @"iPhone 3GS";
if ([platform isEqualToString:@"iPhone3,1"]) return @"iPhone 4";
if ([platform isEqualToString:@"iPhone3,2"]) return @"iPhone 4";
if ([platform isEqualToString:@"iPhone3,3"]) return @"iPhone 4";
if ([platform isEqualToString:@"iPhone4,1"]) return @"iPhone 4S";
if ([platform isEqualToString:@"iPhone5,1"]) return @"iPhone 5";
if ([platform isEqualToString:@"iPhone5,2"]) return @"iPhone 5 (GSM+CDMA)";
if ([platform isEqualToString:@"iPhone5,3"]) return @"iPhone 5c (GSM)";
if ([platform isEqualToString:@"iPhone5,4"]) return @"iPhone 5c (GSM+CDMA)";
if ([platform isEqualToString:@"iPhone6,1"]) return @"iPhone 5s (GSM)";
if ([platform isEqualToString:@"iPhone6,2"]) return @"iPhone 5s (GSM+CDMA)";
if ([platform isEqualToString:@"iPhone7,1"]) return @"iPhone 6 Plus";
if ([platform isEqualToString:@"iPhone7,2"]) return @"iPhone 6";
if ([platform isEqualToString:@"iPhone8,1"]) return @"iPhone 6s";
if ([platform isEqualToString:@"iPhone8,2"]) return @"iPhone 6s Plus";
if ([platform isEqualToString:@"iPhone8,4"]) return @"iPhone SE";
if ([platform isEqualToString:@"iPod1,1"]) return @"iPod Touch (1 Gen)";
if ([platform isEqualToString:@"iPod2,1"]) return @"iPod Touch (2 Gen)";
if ([platform isEqualToString:@"iPod3,1"]) return @"iPod Touch (3 Gen)";
if ([platform isEqualToString:@"iPod4,1"]) return @"iPod Touch (4 Gen)";
if ([platform isEqualToString:@"iPod5,1"]) return @"iPod Touch (5 Gen)";
if ([platform isEqualToString:@"iPad1,1"]) return @"iPad";
if ([platform isEqualToString:@"iPad1,2"]) return @"iPad 3G";
if ([platform isEqualToString:@"iPad2,1"]) return @"iPad 2 (WiFi)";
if ([platform isEqualToString:@"iPad2,2"]) return @"iPad 2";
if ([platform isEqualToString:@"iPad2,3"]) return @"iPad 2 (CDMA)";
if ([platform isEqualToString:@"iPad2,4"]) return @"iPad 2";
if ([platform isEqualToString:@"iPad2,5"]) return @"iPad Mini (WiFi)";
if ([platform isEqualToString:@"iPad2,6"]) return @"iPad Mini";
if ([platform isEqualToString:@"iPad2,7"]) return @"iPad Mini (GSM+CDMA)";
if ([platform isEqualToString:@"iPad3,1"]) return @"iPad 3 (WiFi)";
if ([platform isEqualToString:@"iPad3,2"]) return @"iPad 3 (GSM+CDMA)";
if ([platform isEqualToString:@"iPad3,3"]) return @"iPad 3";
if ([platform isEqualToString:@"iPad3,4"]) return @"iPad 4 (WiFi)";
if ([platform isEqualToString:@"iPad3,5"]) return @"iPad 4";
if ([platform isEqualToString:@"iPad3,6"]) return @"iPad 4 (GSM+CDMA)";
if ([platform isEqualToString:@"iPad4,1"]) return @"iPad Air (WiFi)";
if ([platform isEqualToString:@"iPad4,2"]) return @"iPad Air (Cellular)";
if ([platform isEqualToString:@"iPad4,4"]) return @"iPad Mini 2 (WiFi)";
if ([platform isEqualToString:@"iPad4,5"]) return @"iPad Mini 2 (Cellular)";
if ([platform isEqualToString:@"iPad4,6"]) return @"iPad Mini 2";
if ([platform isEqualToString:@"iPad4,7"]) return @"iPad Mini 3";
if ([platform isEqualToString:@"iPad4,8"]) return @"iPad Mini 3";
if ([platform isEqualToString:@"iPad4,9"]) return @"iPad Mini 3";
if ([platform isEqualToString:@"iPad5,3"]) return @"iPad Air 2";
if ([platform isEqualToString:@"iPad5,4"]) return @"iPad Air 2";
if ([platform isEqualToString:@"i386"]) return @"Simulator";
if ([platform isEqualToString:@"x86_64"]) return @"Simulator";
如果您查看(使用 Xcode 6)内的设备配置文件,/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/CoreSimulator/Profiles/DeviceTypes
您将看到:
iPhone 6 加号: iPhone7,1
iPhone 6: iPhone7,2
Apple 网站上这些页面的 URL(用于“RF Exposure”)似乎证实了:
iPhone 6 加号:7,1
iPhone 6:7,2
这似乎与最新的模型保持同步。