List of exact device names?

I want to implement a check on which device the app is playing. Is it possible to get the information if it is an iPhone, an iPod or a new device like the iPhone5 or even iPhone6 or new iPods with different screen sizes than the older models?

How can I check via code on which of those devices the app is being started?

I want to implement some different code for the older models, because they are very slow regarding the new particle features of corona.

Thx for your help!

For this, system.getInfo() is your friend.  See:

http://docs.coronalabs.com/api/library/system/getInfo.html

You can also determine a lot just from the various items presented by this call.

Rob

Thx for the fast info Rob!

Is there some information about the correct names for an iPhone 4 and iPhone4s when using ‘architectureInfo’? What about the names for iPods of the same category? There is this list for the older devices like:

  • “iPhone1,1” = iPhone 1G
  • “iPhone1,2” = iPhone 3G
  • “iPhone2,1” = iPhone 3GS
  • “iPod1,1” = iPod touch 1G
  • “iPod2,1” = iPod touch 2G

but there isn’t more info about the newer ones or iPods.

Can these name change in the future or is it okay to check for this names in the code, like for example: if it is “iPhone4,1” (if this is the right name) then do XY?

Thx!

Daniela

PS: I don’t have all the mentioned devices here, so I can not test it on actual hardware to get the right names!

You should be able to use Google and search for iPod device names and look for a modern list that lists all devices.  I bet there is a wikipedia page for this.

Thank you for pointing me in this direction! I somehow thought this is Corona related. I found some code snippet with this information…

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+Asis+China)"; if ([platform isEqualToString:@"iPhone6,1"]) return @"iPhone 5s (GSM+CDMA)"; if ([platform isEqualToString:@"iPhone6,2"]) return @"iPhone 5s (UK+Europe+Asis+China)"; 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:@"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 Retina (WiFi)"; if ([platform isEqualToString:@"iPad4,5"]) return @"iPad Mini Retina (GSM+CDMA)"; if ([platform isEqualToString:@"i386"]) return @"Simulator"; if ([platform isEqualToString:@"x86\_64"]) return @"Simulator";

Just keep in mind as Apple comes out with new devices, they will have different values.  We can’t predict what the iPhone 6 will be, in particular with new models.  I

local devices = { -- iPhone ["iPhone1,1"] = "iPhone 2G", ["iPhone1,2"] = "iPhone 3G", ["iPhone2,1"] = "iPhone 3GS", ["iPhone3,1"] = "iPhone 4", ["iPhone3,2"] = "iPhone 4", ["iPhone3,3"] = "iPhone 4 (CDMA)", ["iPhone4,1"] = "iPhone 4S", ["iPhone5,1"] = "iPhone 5", ["iPhone5,2"] = "iPhone 5 (GSM+CDMA)", ["iPhone5,3"] = "iPhone 5c (GSM+CDMA)", ["iPhone5,4"] = "iPhone 5c (UK+Europe+Asis+China)", ["iPhone6,1"] = "iPhone 5s (GSM+CDMA)", ["iPhone6,2"] = "iPhone 5s (UK+Europe+Asis+China)", -- iPod ["iPod1,1"] = "iPod Touch (1 Gen)", ["iPod2,1"] = "iPod Touch (2 Gen)", ["iPod3,1"] = "iPod Touch (3 Gen)", ["iPod4,1"] = "iPod Touch (4 Gen)", ["iPod5,1"] = "iPod Touch (5 Gen)", -- iPad ["iPad1,1"] = "iPad", ["iPad1,2"] = "iPad 3G", ["iPad2,1"] = "iPad 2 (WiFi)", ["iPad2,2"] = "iPad 2", ["iPad2,3"] = "iPad 2 (CDMA)", ["iPad2,4"] = "iPad 2", ["iPad2,5"] = "iPad Mini (WiFi)", ["iPad2,6"] = "iPad Mini", ["iPad2,7"] = "iPad Mini (GSM+CDMA)", ["iPad3,1"] = "iPad 3 (WiFi)", ["iPad3,2"] = "iPad 3 (GSM+CDMA)", ["iPad3,3"] = "iPad 3", ["iPad3,4"] = "iPad 4 (WiFi)", ["iPad3,5"] = "iPad 4", ["iPad3,6"] = "iPad 4 (GSM+CDMA)", ["iPad4,1"] = "iPad Air (WiFi)", ["iPad4,2"] = "iPad Air (GSM+CDMA)", ["iPad4,4"] = "iPad Mini Retina (WiFi)", ["iPad4,5"] = "iPad Mini Retina (GSM+CDMA)", -- Simulator ["i386"] = "Simulator", ["x86\_64"] = "Simulator", ["ppc"] = "Simulator", ["ppc64"] = "Simulator" } local Model = devices[system.getInfo("architectureInfo")] print(" Model : "..Model)

If anyone have a list of android devices feel free to add them and share.

For this, system.getInfo() is your friend.  See:

http://docs.coronalabs.com/api/library/system/getInfo.html

You can also determine a lot just from the various items presented by this call.

Rob

Thx for the fast info Rob!

Is there some information about the correct names for an iPhone 4 and iPhone4s when using ‘architectureInfo’? What about the names for iPods of the same category? There is this list for the older devices like:

  • “iPhone1,1” = iPhone 1G
  • “iPhone1,2” = iPhone 3G
  • “iPhone2,1” = iPhone 3GS
  • “iPod1,1” = iPod touch 1G
  • “iPod2,1” = iPod touch 2G

but there isn’t more info about the newer ones or iPods.

Can these name change in the future or is it okay to check for this names in the code, like for example: if it is “iPhone4,1” (if this is the right name) then do XY?

Thx!

Daniela

PS: I don’t have all the mentioned devices here, so I can not test it on actual hardware to get the right names!

You should be able to use Google and search for iPod device names and look for a modern list that lists all devices.  I bet there is a wikipedia page for this.

Thank you for pointing me in this direction! I somehow thought this is Corona related. I found some code snippet with this information…

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+Asis+China)"; if ([platform isEqualToString:@"iPhone6,1"]) return @"iPhone 5s (GSM+CDMA)"; if ([platform isEqualToString:@"iPhone6,2"]) return @"iPhone 5s (UK+Europe+Asis+China)"; 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:@"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 Retina (WiFi)"; if ([platform isEqualToString:@"iPad4,5"]) return @"iPad Mini Retina (GSM+CDMA)"; if ([platform isEqualToString:@"i386"]) return @"Simulator"; if ([platform isEqualToString:@"x86\_64"]) return @"Simulator";

Just keep in mind as Apple comes out with new devices, they will have different values.  We can’t predict what the iPhone 6 will be, in particular with new models.  I

local devices = { -- iPhone ["iPhone1,1"] = "iPhone 2G", ["iPhone1,2"] = "iPhone 3G", ["iPhone2,1"] = "iPhone 3GS", ["iPhone3,1"] = "iPhone 4", ["iPhone3,2"] = "iPhone 4", ["iPhone3,3"] = "iPhone 4 (CDMA)", ["iPhone4,1"] = "iPhone 4S", ["iPhone5,1"] = "iPhone 5", ["iPhone5,2"] = "iPhone 5 (GSM+CDMA)", ["iPhone5,3"] = "iPhone 5c (GSM+CDMA)", ["iPhone5,4"] = "iPhone 5c (UK+Europe+Asis+China)", ["iPhone6,1"] = "iPhone 5s (GSM+CDMA)", ["iPhone6,2"] = "iPhone 5s (UK+Europe+Asis+China)", -- iPod ["iPod1,1"] = "iPod Touch (1 Gen)", ["iPod2,1"] = "iPod Touch (2 Gen)", ["iPod3,1"] = "iPod Touch (3 Gen)", ["iPod4,1"] = "iPod Touch (4 Gen)", ["iPod5,1"] = "iPod Touch (5 Gen)", -- iPad ["iPad1,1"] = "iPad", ["iPad1,2"] = "iPad 3G", ["iPad2,1"] = "iPad 2 (WiFi)", ["iPad2,2"] = "iPad 2", ["iPad2,3"] = "iPad 2 (CDMA)", ["iPad2,4"] = "iPad 2", ["iPad2,5"] = "iPad Mini (WiFi)", ["iPad2,6"] = "iPad Mini", ["iPad2,7"] = "iPad Mini (GSM+CDMA)", ["iPad3,1"] = "iPad 3 (WiFi)", ["iPad3,2"] = "iPad 3 (GSM+CDMA)", ["iPad3,3"] = "iPad 3", ["iPad3,4"] = "iPad 4 (WiFi)", ["iPad3,5"] = "iPad 4", ["iPad3,6"] = "iPad 4 (GSM+CDMA)", ["iPad4,1"] = "iPad Air (WiFi)", ["iPad4,2"] = "iPad Air (GSM+CDMA)", ["iPad4,4"] = "iPad Mini Retina (WiFi)", ["iPad4,5"] = "iPad Mini Retina (GSM+CDMA)", -- Simulator ["i386"] = "Simulator", ["x86\_64"] = "Simulator", ["ppc"] = "Simulator", ["ppc64"] = "Simulator" } local Model = devices[system.getInfo("architectureInfo")] print(" Model : "..Model)

If anyone have a list of android devices feel free to add them and share.