Skip to main content
Inspiring
January 11, 2012
Question

Is there an easy way to tell what type of iOS device you are on?

  • January 11, 2012
  • 2 replies
  • 1121 views

I have an app that is performing well on iPad2, but bogging down pretty badly on iPad in some situations. Is there a way to query the type of device so I can adapt teh code appropriately?

This topic has been closed for replies.

2 replies

Inspiring
January 13, 2012

i have an ipad2 and an ipod4

i get the following strings from Capabilities.os :

"iPhone OS 5.0.1 iPad2,1"


"iPhone OS 5.0.1 iPod4,1"

I have not checked iPad1 but i would think it returns iPad or iPad1 within the string. You then can parse the string and have your answer at runtime.

There could be other methods, this is the only way i know of to tell iPad1 versus iPad2. I think most other values are going to be the same.


Participant
January 23, 2012

Few more Strings

    

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:@"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:@"iPad1,1"])      return @"iPad";

    if ([platform isEqualToString:@"iPad2,1"])      return @"iPad 2 (WiFi)";

    if ([platform isEqualToString:@"iPad2,2"])      return @"iPad 2 (GSM)";

    if ([platform isEqualToString:@"iPad2,3"])      return @"iPad 2 (CDMA)";

Source: https://gist.github.com/1323251

Inspiring
January 11, 2012

import flash.system.Capabilities;

trace(Capabilities.os);

some more info from the capabilities class:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/Capabilities.html

scober99Author
Inspiring
January 12, 2012

Is there a more complete list of values for the .os string or is what is listed on that page the complete list?