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

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

Answer

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.

Source: stackoverflow
The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .