NSString *deviceUuid = dev.uniqueIdentifier; NSString *deviceName = [dev.name stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]; NSString *deviceModel = [dev.model stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]; NSString *deviceSystemVersion = dev.systemVersion; NSLog(@"uuid=%@ devicename=%@ devicemodel=%@ devicesystemVersion=%@",deviceUuid,deviceName,deviceModel,deviceSystemVersion);
仅记录一下
上面得到的model name却是iphone如果想知道更细节的。
如下做法
struct utsname systemInfo; uname(&systemInfo); return [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
然后到的结果对应关系
iPhone1,1 -> iPhone 1G, M68 iPhone1,2 -> iPhone 3G, N82 iPhone2,1 -> iPhone 3GS, N88 iPhone3,1 -> iPhone 4/AT&T, N89 iPhone3,2 -> iPhone 4/Other Carrier?, ?? iPhone3,3 -> iPhone 4/Verizon, TBD iPhone4,1 -> (iPhone 5/AT&T), TBD iPhone4,2 -> (iPhone 5/Verizon), TBD iPod1,1 -> iPod touch 1G, N45 iPod2,1 -> iPod touch 2G, N72 iPod2,2 -> Unknown, ?? iPod3,1 -> iPod touch 3G, N18 iPod4,1 -> iPod touch 4G, N80 // Thanks NSForge iPad1,1 -> iPad 1G, WiFi and 3G, K48 iPad2,1 -> iPad 2G, WiFi, K93 iPad2,2 -> iPad 2G, GSM 3G, K94 iPad2,3 -> iPad 2G, CDMA 3G, K95 iPad3,1 -> (iPad 3G, GSM) iPad3,2 -> (iPad 3G, CDMA) AppleTV2,1 -> AppleTV 2, K66 i386, x86_64 -> iPhone Simulator