如何通过代码获取iPhone的设备监督模型,如A1532?

问题描述:

最近我需要生成一个Mac软件来获取iPhone设备信息,但我无法通过代码获取设备监督模型。 我用mobileDeviceManager得到的信息是我need.There是一个示例代码:如何通过代码获取iPhone的设备监督模型,如A1532?

- (NSString*)serialNumber { 
    return [self deviceValueForKey:@"SerialNumber"]; 
} 
// Returns an informational value from the device's root domain. 
// @param key can apparently be any value like DeviceName... 

不幸的是,我无法找到键搞定设备监理的价值model.Can我从设备监管模式通过代码没有越狱iPhone?

试试这个:

#include <sys/sysctl.h> 
#include <sys/utsname.h> 

+ (NSString *)deviceName { 
    struct utsname systemInfo; 
    uname(&systemInfo); 
    return [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding]; 
} 
+0

它打印“x86_64的” ......我想,也许它告诉我们Mac的信息 – 0x11901

+0

也许我误解了这个问题。我的代码是iOS应用程序。 – Alexey

+0

那么你有关Mac应用程序的任何想法? – 0x11901