22

例如,iPhone 5 是“iPhone5,1”还是“iPhone5,2”?又有什么区别呢?</p>

如果有人拥有 iPhone 5,请通过运行以下代码并显示结果来提供帮助。谢谢你。

相关链接:https ://stackoverflow.com/a/3950748/482899

4

9 回答 9

35

您可以在此处找到所有 iOS 设备标识符的列表(包括 iPhone 5 型号和 iPad mini): http ://theiphonewiki.com/wiki/index.php?title=Models

最新型号的标识符为:

iPhone 5:iPhone5,1 和 iPhone5,2

iPhone 5C:iPhone5,3 和 iPhone5,4

iPhone 5S:iPhone6,1 和 iPhone6,2

iPhone 6:iPhone7,2

iPhone 6 Plus:iPhone7,1

iPhone 6S:iPhone8,1

iPhone 6S Plus:iPhone8,2

iPhone SE:iPhone8,4

iPhone 7:iPhone9,1 和 iPhone9,3

iPhone 7 Plus:iPhone9,2 和 iPhone9,4

iPhone 8:iPhone10,1 和 iPhone10,4

iPhone 8 Plus:iPhone10,2 和 iPhone10,5

iPhone X:iPhone10,3 和 iPhone10,6

编辑:我还制作了流行的 iOS 支持矩阵的更新版本,包括 iPhone X 之前的所有型号。

于 2012-11-05T13:50:43.460 回答
28
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 (CDMA)";
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+CDMA)";
if ([platform isEqualToString:@"iPhone5,4"])    return @"iPhone 5c (UK+Europe+Asia+China)";
if ([platform isEqualToString:@"iPhone6,1"])    return @"iPhone 5s (GSM+CDMA)";
if ([platform isEqualToString:@"iPhone6,2"])    return @"iPhone 5s (UK+Europe+Asia+China)";
if ([platform isEqualToString:@"iPhone7,1"])    return @"iPhone 6 Plus";
if ([platform isEqualToString:@"iPhone7,2"])    return @"iPhone 6";

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:@"iPod7,1"])      return @"iPod Touch (6 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 (GSM+CDMA)";
if ([platform isEqualToString:@"iPad4,4"])      return @"iPad Mini 2 (WiFi)";
if ([platform isEqualToString:@"iPad4,5"])      return @"iPad Mini 2 (GSM+CDMA)";
if ([platform isEqualToString:@"iPad4,6"])      return @"iPad Mini 2 (China)";
if ([platform isEqualToString:@"iPad4,7"])      return @"iPad Mini 3 (WiFi)";
if ([platform isEqualToString:@"iPad4,8"])      return @"iPad Mini 3 (GSM+CDMA)";
if ([platform isEqualToString:@"iPad4,9"])      return @"iPad Mini 3 (China)";
if ([platform isEqualToString:@"iPad5,3"])      return @"iPad Air 2 (WiFi)";
if ([platform isEqualToString:@"iPad5,4"])      return @"iPad Air 2";

if ([platform isEqualToString:@"i386"])         return @"Simulator";
if ([platform isEqualToString:@"x86_64"])       return @"Simulator";

return platform;  
于 2013-11-14T20:45:59.003 回答
11

此方法涵盖市场上的所有设备:

- (NSString *) platform{
int mib[2];
size_t len;
char *machine;

mib[0] = CTL_HW;
mib[1] = HW_MACHINE;
sysctl(mib, 2, NULL, &len, NULL, 0);
machine = malloc(len);
sysctl(mib, 2, machine, &len, NULL, 0);

NSString *platform = [NSString stringWithCString:machine encoding:NSASCIIStringEncoding];
free(machine);
return platform; }

- (NSString *) platformString{
NSString *platform = [self platform];
if ([platform isEqualToString:@"iPhone1,1"])    return @"iPhone 1G";
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,3"])    return @"Verizon iPhone 4";
if ([platform isEqualToString:@"iPhone4,1"])    return @"iPhone 4S";
if ([platform isEqualToString:@"iPhone5,1"])    return @"iPhone 5 (GSM)";
if ([platform isEqualToString:@"iPhone5,2"])    return @"iPhone 5 (GSM+CDMA)";
if ([platform isEqualToString:@"iPhone5,3"])    return @"iPhone 5c (GSM+CDMA)";
if ([platform isEqualToString:@"iPhone5,4"])    return @"iPhone 5c (UK+Europe+Asia+China)";
if ([platform isEqualToString:@"iPhone6,1"])    return @"iPhone 5s (GSM+CDMA)";
if ([platform isEqualToString:@"iPhone6,2"])    return @"iPhone 5s (UK+Europe+Asia+China)";
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:@"iPhone9,1"])    return @"iPhone 7";
if ([platform isEqualToString:@"iPhone9,2"])    return @"iPhone 7 Plus";
if ([platform isEqualToString:@"iPhone9,3"])    return @"iPhone 7";
if ([platform isEqualToString:@"iPhone9,4"])    return @"iPhone 7 Plus";


if ([platform isEqualToString:@"iPod1,1"])      return @"iPod Touch 1G";
if ([platform isEqualToString:@"iPod2,1"])      return @"iPod Touch 2G";
if ([platform isEqualToString:@"iPod3,1"])      return @"iPod Touch 3G";
if ([platform isEqualToString:@"iPod4,1"])      return @"iPod Touch 4G";
if ([platform isEqualToString:@"iPod5,1"])      return @"iPod Touch 5G";

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";
return platform; }
于 2013-06-23T13:11:13.790 回答
4

是的,“iPhone5,1”是GSM iPhone 5,“iPhone5,2”是CDMA iPhone 5,“iPhone5,3”是GSM iPhone 5C,“iPhone5,4”是CDMA iPhone 5C,“iPhone6,1 " 是 GSM iPhone 5S, "iPhone6,2" 是 CDMA iPhone 5S。这是否回答你的问题?

于 2013-09-23T18:11:29.407 回答
3

Verizon iPhone 5 返回“iPhone5,2”。GSM 手机返回“iPhone5,1”。

于 2012-09-21T17:43:54.163 回答
3

它看起来像 iPhone5,1 或 iPhone5,2,具体取决于 iPhone 5 的型号。

来自知名 iOS 开发者 @marcoarment:

iPhone5,1:型号 A1428,AT&T/加拿大

iPhone5,2:型号 A1429,所有其他

A1429可能有两种模式,但我没有看到任何iPhone5,3的记录。

来源:https ://twitter.com/marcoarment/status/249249183029161984

于 2012-09-21T22:25:33.090 回答
1

我创建了一个用于在运行时检测设备的库。

它被称为SDVersion

认为有些人可能会发现它很有用。

于 2015-08-26T22:50:37.540 回答
1

[更新]
iPhone10,1 : iPhone 8
iPhone10,2 : iPhone 8 Plus
iPhone10,3 : iPhone X 全球
iPhone10,4 : iPhone 8
iPhone10,5 : iPhone 8 Plus
iPhone10,6 : iPhone X GSM
iPhone11,2 : iPhone XS
iPhone11 ,4 : iPhone XS Max
iPhone11,6 : iPhone XS Max Global
iPhone11,8 : iPhone XR
iPhone12,1 : iPhone 11
iPhone12,3 : iPhone 11 Pro
iPhone12,5 : iPhone 11 Pro Max
iPhone12,8 : iPhone SE 2nd Gen

于 2017-10-03T05:06:48.857 回答
0

在这里查看您的答案如何检测 iPhone 5(宽屏设备)?. 直到现在我还没有找到任何答案,直到某个开发者购买了 iPhone 5 并发布了一些有用的信息

于 2012-09-20T05:27:49.517 回答