// 需要#import "sys/utsname.h"
struct utsname systemInfo;
uname(&systemInfo);
NSString * deviceString = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
if ([deviceString isEqualToString:@"iPhone3,1"]) return @"iPhone 4";
if ([deviceString isEqualToString:@"iPhone3,2"]) return @"iPhone 4";
if ([deviceString isEqualToString:@"iPhone3,3"]) return @"iPhone 4";
if ([deviceString isEqualToString:@"iPhone4,1"]) return @"iPhone 4s";
if ([deviceString isEqualToString:@"iPhone5,1"]) return @"iPhone 5";
if ([deviceString isEqualToString:@"iPhone5,2"]) return @"iPhone 5";
if ([deviceString isEqualToString:@"iPhone5,3"]) return @"iPhone 5c";
if ([deviceString isEqualToString:@"iPhone5,4"]) return @"iPhone 5c";
if ([deviceString isEqualToString:@"iPhone6,1"]) return @"iPhone 5s";
if ([deviceString isEqualToString:@"iPhone6,2"]) return @"iPhone 5s";
if ([deviceString isEqualToString:@"iPhone7,1"]) return @"iPhone 6 Plus";
if ([deviceString isEqualToString:@"iPhone7,2"]) return @"iPhone 6";
if ([deviceString isEqualToString:@"iPhone8,1"]) return @"iPhone 6s";
if ([deviceString isEqualToString:@"iPhone8,2"]) return @"iPhone 6s Plus";
if ([deviceString isEqualToString:@"iPhone8,4"]) return @"iPhone SE";
if ([deviceString isEqualToString:@"iPhone9,1"]) return @"iPhone 7";
if ([deviceString isEqualToString:@"iPhone9,2"]) return @"iPhone 7 Plus";
if ([deviceString isEqualToString:@"iPhone9,3"]) return @"iPhone 7";
if ([deviceString isEqualToString:@"iPhone9,4"]) return @"iPhone Plus";
if ([deviceString isEqualToString:@"iPhone10,1"]) return @"iPhone 8";
if ([deviceString isEqualToString:@"iPhone10,2"]) return @"iPhone 8 Plus";
if ([deviceString isEqualToString:@"iPhone10,3"]) return @"iPhone X global";
if ([deviceString isEqualToString:@"iPhone10,4"]) return @"iPhone 8";
if ([deviceString isEqualToString:@"iPhone10,5"]) return @"iPhone 8 Plus";
if ([deviceString isEqualToString:@"iPhone10,6"]) return @"iPhone X GSM";
if ([deviceString isEqualToString:@"iPhone11,2"]) return @"iPhone XS";
if ([deviceString isEqualToString:@"iPhone11,4"]) return @"iPhone XS Max China";
if ([deviceString isEqualToString:@"iPhone11,6"]) return @"iPhone XS Max";
if ([deviceString isEqualToString:@"iPhone11,8"]) return @"iPhone XR";
if ([deviceString isEqualToString:@"iPhone12,1"]) return @"iPhone 11";
if ([deviceString isEqualToString:@"iPhone12,2"]) return @"iPhone 11 pro";
if ([deviceString isEqualToString:@"iPhone12,5"]) return @"iPhone 11 pro Max";
if([deviceString isEqualToString:@"iPhone13,1"]) return @"iPhone 12 mini";
if([deviceString isEqualToString:@"iPhone13,2"]) return @"iPhone 12";
if([deviceString isEqualToString:@"iPhone13,3"]) return @"iPhone 12 Pro";
if([deviceString isEqualToString:@"iPhone13,4"]) return @"iPhone 12 Pro Max";
if ([deviceString isEqualToString:@"iPhone14,4"]) return @"iPhone 13 mini";
if ([deviceString isEqualToString:@"iPhone14,5"]) return @"iPhone 13";
if ([deviceString isEqualToString:@"iPhone14,2"]) return @"iPhone 13 Pro";
if ([deviceString isEqualToString:@"iPhone14,3"]) return @"iPhone 13 Pro Max";
return deviceString;
iOS 判断当前手机型号
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...