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

By | December 4, 2017
Questions:

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

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.

Questions:
Answers:
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;  

Questions:
Answers:

This method covers all devices in market:

- (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; }

Questions:
Answers:

Yup, “iPhone5,1” is the GSM iPhone 5, “iPhone5,2” is the CDMA iPhone 5, “iPhone5,3” is the GSM iPhone 5C, “iPhone5,4” is the CDMA iPhone 5C, “iPhone6,1” is the GSM iPhone 5S, and “iPhone6,2” is the CDMA iPhone 5S. Does that answer your question?

Questions:
Answers:

It looks like either iPhone5,1 or iPhone5,2 depending on the model of iPhone 5.

From @marcoarment, who is a well known iOS Developer:

iPhone5,1: model A1428, AT&T/Canada

iPhone5,2: model A1429, all others

A1429 may have two modes, but I don’t see any iPhone5,3 records.

Source: https://twitter.com/marcoarment/status/249249183029161984

Questions:
Answers:

The Verizon iPhone 5 returns “iPhone5,2”. The GSM phone returns “iPhone5,1”.

Questions:
Answers:

I created a library for detecting the device at runtime.

It’s called SDVersion.

Thought some may found it useful.

Questions:
Answers:

[Update] platform name of iphone8 is iPhone10,1

[Update] platform name of iphoneX is iPhone10,3

Questions:
Answers:

check out your answer over here How to detect iPhone 5 (widescreen devices)?. till now i have not found any answer until some one developer buy iPhone 5 and post some useful information

Leave a Reply

Your email address will not be published. Required fields are marked *