Ale*_*Mal 3 iphone device hardware-id ipad
我在我的应用程序中使用此功能返回我的设备的型号名称并且工作得很好,但我如何找到此功能的返回值的完整列表(es为iphone3,3gs,4s,ipad,ipad2,ipod ecc ecc
size_t size;
sysctlbyname("hw.machine", NULL, &size, NULL, 0);
char *machine = malloc(size);
sysctlbyname("hw.machine", machine, &size, NULL, 0);
NSString *platform = [NSString stringWithCString:machine];
free(machine);
return platform;
Run Code Online (Sandbox Code Playgroud)
谢谢
您还可以使用以下类来获取移动操作系统的所有详细信息UIDevice:
NSLog(@"uniqueIdentifier: %@", [[UIDevice currentDevice] uniqueIdentifier]);
NSLog(@"name: %@", [[UIDevice currentDevice] name]);
NSLog(@"systemName: %@", [[UIDevice currentDevice] systemName]);
NSLog(@"systemVersion: %@", [[UIDevice currentDevice] systemVersion]);
NSLog(@"model: %@", [[UIDevice currentDevice] model]);
NSLog(@"localizedModel: %@", [[UIDevice currentDevice] localizedModel]);
Run Code Online (Sandbox Code Playgroud)