iphone - How to identify a "hw.machine" identifier reliable? -


i'm looking official source complete/maintain method:

-(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,2"])    return @"iphone 4 (other carrier)";     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:@"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:@"ipad2,1"])      return @"ipad 2 wifi";     if ([platform isequaltostring:@"ipad2,2"])      return @"ipad 2 gsm";     if ([platform isequaltostring:@"ipad2,3"])      return @"ipad 2 cdma";     if ([platform isequaltostring:@"ipad2,4"])      return @"ipad 2 cdmas";     if ([platform isequaltostring:@"ipad2,5"])      return @"ipad mini wifi";     if ([platform isequaltostring:@"ipad2,6"])      return @"ipad mini (cellular att)";     if ([platform isequaltostring:@"ipad2,7"])      return @"ipad mini (cellular verizon)";      if ([platform isequaltostring:@"ipad3,1"])      return @"ipad 3 wifi";     if ([platform isequaltostring:@"ipad3,2"])      return @"ipad 3 cdma";     if ([platform isequaltostring:@"ipad3,3"])      return @"ipad 3 gsm";     if ([platform isequaltostring:@"ipad3,4"])      return @"ipad 4 wifi";     if ([platform isequaltostring:@"ipad3,5"])      return @"ipad 3 (cellular att)";     if ([platform isequaltostring:@"ipad3,6"])      return @"ipad 3 (cellular verizon)";      if ([platform isequaltostring:@"ipad4,1"])      return @"ipad 4 wifi";     if ([platform isequaltostring:@"ipad4,2"])      return @"ipad 4 gsm";     if ([platform isequaltostring:@"ipad4,3"])      return @"ipad 4 cdma";      if ([platform isequaltostring:@"i386"])         return @"simulator";     if ([platform isequaltostring:@"x86_64"])       return @"simulator";      return [nsstring stringwithformat:@"unknown: %@", platform]; } 

does apple have statement somewhere?

or explorous person decent research somewhere?


fo clarification, i'm using code under hood:

-(nsstring*)getsysinfobyname:(char*) typespecifier {     size_t size;     sysctlbyname(typespecifier, null, &size, null, 0);      char *answer = malloc(size);     sysctlbyname(typespecifier, answer, &size, null, 0);      nsstring *results = [nsstring stringwithcstring:answer encoding: nsutf8stringencoding];      free(answer);     return results; }  -(nsstring*)platform { return [self getsysinfobyname:"hw.machine"]; } 

some non-official source i've found far:

models - iphone wiki

iclarified - iphone - download iphone firmware files from

iclarified - ipad - download ipad firmware files from

iclarified - ipod touch - download ipod touch firmware files from

still looking more official source, though.


just extracted iphone wiki (up till iphone 5s, ipad air):

-(nsdictionary*)devicemodeldataformachineids {     return @{           //ipad.          @"ipad1,1" : @[ @"ipad 1g", @"wi-fi / gsm", @"a1219 / a1337" ],          @"ipad2,1" : @[ @"ipad 2", @"wi-fi", @"a1395" ],          @"ipad2,2" : @[ @"ipad 2", @"gsm", @"a1396" ],          @"ipad2,3" : @[ @"ipad 2", @"cdma", @"a1397" ],          @"ipad2,4" : @[ @"ipad 2", @"wi-fi rev a", @"a1395" ],          @"ipad2,5" : @[ @"ipad mini", @"wi-fi", @"a1432" ],          @"ipad2,6" : @[ @"ipad mini", @"gsm", @"a1454" ],          @"ipad2,7" : @[ @"ipad mini", @"gsm+cdma", @"a1455" ],          @"ipad3,1" : @[ @"ipad 3", @"wi-fi", @"a1416" ],          @"ipad3,2" : @[ @"ipad 3", @"gsm+cdma", @"a1403" ],          @"ipad3,3" : @[ @"ipad 3", @"gsm", @"a1430" ],          @"ipad3,4" : @[ @"ipad 4", @"wi-fi", @"a1458" ],          @"ipad3,5" : @[ @"ipad 4", @"gsm", @"a1459" ],          @"ipad3,6" : @[ @"ipad 4", @"gsm+cdma", @"a1460" ],          @"ipad4,1" : @[ @"ipad air", @"wi‑fi", @"a1474" ],          @"ipad4,2" : @[ @"ipad air", @"cellular", @"a1475" ],          @"ipad4,4" : @[ @"ipad mini 2", @"wi‑fi", @"a1489" ],          @"ipad4,5" : @[ @"ipad mini 2", @"cellular", @"a1517" ],          @"ipad4,6" : @[ @"ipad mini 2", @"n/a", @"a1491" ],          @"ipad4,7" : @[ @"ipad mini 3", @"n/a", @"a1599" ],          @"ipad4,8" : @[ @"ipad mini 3", @"n/a", @"a1600" ],          @"ipad4,9" : @[ @"ipad mini 3", @"n/a", @"a1601" ],          @"ipad5,3" : @[ @"ipad air 2", @"n/a", @"a1566" ],          @"ipad5,4" : @[ @"ipad air 2", @"n/a", @"a1567" ],           //iphone.          @"iphone1,1" : @[ @"iphone 2g", @"gsm", @"a1203" ],          @"iphone1,2" : @[ @"iphone 3g", @"gsm", @"a1241 / a13241" ],          @"iphone2,1" : @[ @"iphone 3gs", @"gsm", @"a1303 / a13251" ],          @"iphone3,1" : @[ @"iphone 4", @"gsm", @"a1332" ],          @"iphone3,2" : @[ @"iphone 4", @"gsm rev a", @"-" ],          @"iphone3,3" : @[ @"iphone 4", @"cdma", @"a1349" ],          @"iphone4,1" : @[ @"iphone 4s", @"gsm+cdma", @"a1387 / a14311" ],          @"iphone5,1" : @[ @"iphone 5", @"gsm", @"a1428" ],          @"iphone5,2" : @[ @"iphone 5", @"gsm+cdma", @"a1429 / a14421" ],          @"iphone5,3" : @[ @"iphone 5c", @"gsm", @"a1456 / a1532" ],          @"iphone5,4" : @[ @"iphone 5c", @"global", @"a1507 / a1516 / a1526 / a1529" ],          @"iphone6,1" : @[ @"iphone 5s", @"gsm", @"a1433 / a1533" ],          @"iphone6,2" : @[ @"iphone 5s", @"global", @"a1457 / a1518 / a1528 / a1530" ],          @"iphone7,2" : @[ @"iphone 6", @"n/a", @"a1549 / a1586" ],          @"iphone7,1" : @[ @"iphone 6 plus", @"n/a", @"a1522 / a1524" ],           //ipod.          @"ipod1,1" : @[ @"ipod touch 1g", @"-", @"a1213" ],          @"ipod2,1" : @[ @"ipod touch 2g", @"-", @"a1288" ],          @"ipod3,1" : @[ @"ipod touch 3g", @"-", @"a1318" ],          @"ipod4,1" : @[ @"ipod touch 4g", @"-", @"a1367" ],          @"ipod5,1" : @[ @"ipod touch 5g", @"-", @"a1421 / a1509" ]      }; } 

it part of eppz!kit on github along rest of code. implemented in eppzdevice.h class.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -