Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the device code (platform string) for iPhone 5 / 5c / 5s / iPod touch 5?

Tags:

For example, is it "iPhone5,1" or "iPhone5,2" for iPhone 5? And what's the difference?

If anyone has the iPhone 5, please help by running the following code and showing your result. Thank you.

Related Link: https://stackoverflow.com/a/3950748/482899

like image 350
northtree Avatar asked Sep 20 '12 02:09

northtree


2 Answers

You can find a list of all iOS device identifiers here (including iPhone 5 models and iPad mini): http://theiphonewiki.com/wiki/index.php?title=Models

The identifiers of the latest models are:

iPhone 5: iPhone5,1 and iPhone5,2

iPhone 5C: iPhone5,3 and iPhone5,4

iPhone 5S: iPhone6,1 and 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 and iPhone9,3

iPhone 7 Plus: iPhone9,2 and iPhone9,4

iPhone 8: iPhone10,1 and iPhone10,4

iPhone 8 Plus: iPhone10,2 and iPhone10,5

iPhone X: iPhone10,3 and iPhone10,6

EDIT: I also made an updated version of the popular iOS Support Matrix including all models up to iPhone X.

like image 196
Dorian Roy Avatar answered Oct 17 '22 03:10

Dorian Roy


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;   
like image 30
Corey Avatar answered Oct 17 '22 03:10

Corey