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
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.
This method covers all devices in market:
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?
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:
Source: https://twitter.com/marcoarment/status/249249183029161984
[Update] platform name of iphone8 is
iPhone10,1
[Update] platform name of iphoneX is
iPhone10,3