IOS Devices Version

游戏项目中有一个专门用于收集IOS崩溃的接口和查询页,运营/测试的同事有时候会通过查询页大概看一下每日崩溃的情况,经常会问iPhone6,1是什么,iPhone7,1又是什么设备?

 

我从网上仔细搜索了一下,目前最全的是来自维基百科的:List of iOS devices

其中Hardware strings这一栏目前是最全的,iPhone后面第一位数字表示的是第几代iPhone,比如上面的7,表示第7代iphone,也就是iphone6。下面来列一下iphone设备列表

 

Apple iPhone Hardware identifier
iPhone(Original/1st Gen/EDGE) iPhone1,1
iPhone 3G iPhone1,2
iPhone 3GS iPhone2,1
iPhone 3G(China/No Wi-Fi) iPhone1,2
iPhone 3GS(China/No Wi-Fi) iPhone2,1
iPhone 4(GSM) iPhone3,1
iPhone 4 (CDMA/Verizon/Sprint) iPhone3,3
iPhone 4S iPhone4,1
iPhone 5 (GSM/LTE 4, 17/North America) iPhone5,1
iPhone 5 (CDMA/LTE, Sprint/Verizon/KDDI) iPhone5,2
iPhone 5 (GSM/LTE 1, 3, 5/International) iPhone5,1
iPhone 5 (CDMA China/UIM/WAPI) iPhone5,2
iPhone 5 (GSM/LTE/AWS/North America) iPhone5,1
iPhone 5c (GSM/North America/A1532) iPhone5,3
iPhone 5c (CDMA/Verizon/A1532) iPhone5,3
iPhone 5c (UK/Europe/Middle East/A1507) iPhone5,4
iPhone 5c (China Mobile/A1516) iPhone5,4
iPhone 5c (China Unicom/A1526) iPhone5,4
iPhone 5s (CDMA/Verizon/A1533) iPhone6,1
iPhone 5s (CDMA/China Telecom/A1533) iPhone6,1
iPhone 5s (China Mobile/A1518) iPhone6,2
iPhone 6 (GSM/North America/A1549) iPhone7,2
iPhone 6 (CDMA/Verizon/A1549) iPhone7,2
iPhone 6 (China Mobile/A1589) iPhone7,2
iPhone 6 Plus (China Mobile/A1593) iPhone7,1

表格数据来源:http://www.everymac.com/systems/apple/iphone/index-iphone-specs.html

 

每一代Phone,都有很多不同的版本,比如韩版、欧版、港版的区分,iPad更有3G/WiFi的区分,所以上述方法只能判断出当前设备大概是什么型号,不是很精准,针对某些设置上才出现的bug,可能需要更深入的一些细分了。不过,通常来看,设备型号 + IOS系统版本,基本上就很容易复现问题了,越狱对bug的影响越来越小。

 

今年,Apple Watch又发布了,所以又加了俩:Watch1,1、Watch1,2(鉴于watch的屏幕、性能限制,暂时没什么游戏能上的去,可以忽略),除此之外,还有Apple TV,貌似在国内还没啥市场也可以暂时忽略。上面列表也只是列出了iPhone、iPad,其它的还有iPod touch,有兴趣可以参考这里:

http://theiphonewiki.com/wiki/Models

 

这里提供一份示例代码:

- (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)";
    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:@"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:@"iPad2,1"])      return @"iPad 2 (WiFi)";
    if ([platform isEqualToString:@"iPad2,2"])      return @"iPad 2 (GSM)";
    if ([platform isEqualToString:@"iPad2,3"])      return @"iPad 2 (CDMA)";
    if ([platform isEqualToString:@"iPad2,4"])      return @"iPad 2 (WiFi)";
    if ([platform isEqualToString:@"iPad2,5"])      return @"iPad Mini (WiFi)";
    if ([platform isEqualToString:@"iPad2,6"])      return @"iPad Mini (GSM)";
    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 (GSM)";
    if ([platform isEqualToString:@"iPad3,4"])      return @"iPad 4 (WiFi)";
    if ([platform isEqualToString:@"iPad3,5"])      return @"iPad 4 (GSM)";
    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 2G (WiFi)";
    if ([platform isEqualToString:@"iPad4,5"])      return @"iPad mini 2G (Cellular)";
    if ([platform isEqualToString:@"i386"])         return @"Simulator";
    if ([platform isEqualToString:@"x86_64"])       return @"Simulator";

    return platform;
}

更多参考:

[1]How to check iOS version?

[2]Determine device (iPhone, iPod Touch) with iPhone SDK

[3]The iPhone wiki Models

posted @ 2015-05-04 14:53  meteoric_cry  阅读(611)  评论(0编辑  收藏  举报