-
(NSString*)deviceModel
{
// 需要#import "sys/utsname.h"
struct utsname systemInfo;
uname(&systemInfo);
NSString * platform = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];// iPhone
if ([platform isEqualToString:@"iPhone1,1"]) return @"iPhone2G";
if ([platform isEqualToString:@"iPhone1,2"]) return @"iPhone3G";
if ([platform isEqualToString:@"iPhone2,1"]) return @"iPhone3GS";
if ([platform isEqualToString:@"iPhone3,1"]) return @"iPhone4";
if ([platform isEqualToString:@"iPhone3,2"]) return @"iPhone4";
if ([platform isEqualToString:@"iPhone3,3"]) return @"iPhone4";
if ([platform isEqualToString:@"iPhone4,1"]) return @"iPhone4S";
if ([platform isEqualToString:@"iPhone5,1"]) return @"iPhone5";
if ([platform isEqualToString:@"iPhone5,2"]) return @"iPhone5";
if ([platform isEqualToString:@"iPhone5,3"]) return @"iPhone5c";
if ([platform isEqualToString:@"iPhone5,4"]) return @"iPhone5c";
if ([platform isEqualToString:@"iPhone6,1"]) return @"iPhone5s";
if ([platform isEqualToString:@"iPhone6,2"]) return @"iPhone5s";
if ([platform isEqualToString:@"iPhone7,2"]) return @"iPhone6";
if ([platform isEqualToString:@"iPhone7,1"]) return @"iPhone6Plus";
if ([platform isEqualToString:@"iPhone8,1"]) return @"iPhone6s";
if ([platform isEqualToString:@"iPhone8,2"]) return @"iPhone6sPlus";
if ([platform isEqualToString:@"iPhone8,3"]) return @"iPhoneSE";
if ([platform isEqualToString:@"iPhone8,4"]) return @"iPhoneSE";
if ([platform isEqualToString:@"iPhone9,1"]) return @"iPhone7";
if ([platform isEqualToString:@"iPhone9,2"]) return @"iPhone7Plus";
if ([platform isEqualToString:@"iPhone9,3"]) return @"iPhone7";
if ([platform isEqualToString:@"iPhone9,4"]) return @"iPhone7Plus";
if ([platform isEqualToString:@"iPhone10,1"]) return @"iPhone 8";
if ([platform isEqualToString:@"iPhone10,4"]) return @"iPhone 8";
if ([platform isEqualToString:@"iPhone10,2"]) return @"iPhone 8 Plus";
if ([platform isEqualToString:@"iPhone10,5"]) return @"iPhone 8 Plus";
if ([platform isEqualToString:@"iPhone10,3"]) return @"iPhone X";
if ([platform isEqualToString:@"iPhone10,6"]) return @"iPhone X";//iPod Touch
if ([platform isEqualToString:@"iPod1,1"]) return @"iPod Touch";
if ([platform isEqualToString:@"iPod2,1"]) return @"iPod Touch2G";
if ([platform isEqualToString:@"iPod3,1"]) return @"iPod Touch3G";
if ([platform isEqualToString:@"iPod4,1"]) return @"iPod Touch4G";
if ([platform isEqualToString:@"iPod5,1"]) return @"iPod Touch5G";
if ([platform isEqualToString:@"iPod7,1"]) return @"iPod Touch6G";//iPad
if ([platform isEqualToString:@"iPad1,1"]) return @"iPad";
if ([platform isEqualToString:@"iPad2,1"]) return @"iPad2";
if ([platform isEqualToString:@"iPad2,2"]) return @"iPad2";
if ([platform isEqualToString:@"iPad2,3"]) return @"iPad2";
if ([platform isEqualToString:@"iPad2,4"]) return @"iPad2";
if ([platform isEqualToString:@"iPad3,1"]) return @"iPad3";
if ([platform isEqualToString:@"iPad3,2"]) return @"iPad3";
if ([platform isEqualToString:@"iPad3,3"]) return @"iPad3";
if ([platform isEqualToString:@"iPad3,4"]) return @"iPad4";
if ([platform isEqualToString:@"iPad3,5"]) return @"iPad4";
if ([platform isEqualToString:@"iPad3,6"]) return @"iPad4";
if ([platform isEqualToString:@"iPad6,11"]) return @"iPad(9.7)";
if ([platform isEqualToString:@"iPad6,12"]) return @"iPad(9.7)";//iPad Air
if ([platform isEqualToString:@"iPad4,1"]) return @"iPadAir";
if ([platform isEqualToString:@"iPad4,2"]) return @"iPadAir";
if ([platform isEqualToString:@"iPad4,3"]) return @"iPadAir";
if ([platform isEqualToString:@"iPad5,3"]) return @"iPadAir2";
if ([platform isEqualToString:@"iPad5,4"]) return @"iPadAir2";//iPad mini
if ([platform isEqualToString:@"iPad2,5"]) return @"iPad mini1G";
if ([platform isEqualToString:@"iPad2,6"]) return @"iPad mini1G";
if ([platform isEqualToString:@"iPad2,7"]) return @"iPad mini1G";
if ([platform isEqualToString:@"iPad4,4"]) return @"iPad mini2";
if ([platform isEqualToString:@"iPad4,5"]) return @"iPad mini2";
if ([platform isEqualToString:@"iPad4,6"]) return @"iPad mini2";
if ([platform isEqualToString:@"iPad4,7"]) return @"iPad mini3";
if ([platform isEqualToString:@"iPad4,8"]) return @"iPad mini3";
if ([platform isEqualToString:@"iPad4,9"]) return @"iPad mini3";
if ([platform isEqualToString:@"iPad5,1"]) return @"iPad mini4";
if ([platform isEqualToString:@"iPad5,2"]) return @"iPad mini4";//iPad Pro
if ([platform isEqualToString:@"iPad6,3"]) return @"iPad Pro(9.7)";
if ([platform isEqualToString:@"iPad6,4"]) return @"iPad Pro(9.7)";
if ([platform isEqualToString:@"iPad6,7"]) return @"iPad Pro(12.9)";
if ([platform isEqualToString:@"iPad6,8"]) return @"iPad Pro(12.9)";
if ([platform isEqualToString:@"iPad7,1"]) return @"iPad Pro2(12.9)";
if ([platform isEqualToString:@"iPad7,2"]) return @"iPad Pro2(12.9)";
if ([platform isEqualToString:@"iPad7,3"]) return @"iPad Pro2(10.5)";
if ([platform isEqualToString:@"iPad7,4"]) return @"iPad Pro2(10.5)";if ([platform isEqualToString:@"i386"]) return @"iPhoneSimulator";
if ([platform isEqualToString:@"x86_64"]) return @"iPhoneSimulator";return platform;
}
ios史上最全的獲取手機(jī)型號(hào)方法
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
- 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來缭黔,“玉大人食茎,你說我怎么就攤上這事×蠼鳎” “怎么了别渔?”我有些...
- 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)惧互。 經(jīng)常有香客問我钠糊,道長(zhǎng),這世上最難降的妖魔是什么壹哺? 我笑而不...
- 正文 為了忘掉前任,我火速辦了婚禮艘刚,結(jié)果婚禮上管宵,老公的妹妹穿的比我還像新娘。我一直安慰自己攀甚,他們只是感情好箩朴,可當(dāng)我...
- 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著秋度,像睡著了一般炸庞。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上荚斯,一...
- 文/蒼蘭香墨 我猛地睜開眼胁孙,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來了称鳞?” 一聲冷哼從身側(cè)響起涮较,我...
- 序言:老撾萬榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎冈止,沒想到半個(gè)月后狂票,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
- 正文 獨(dú)居荒郊野嶺守林人離奇死亡靶瘸,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
- 正文 我和宋清朗相戀三年苫亦,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片怨咪。...
- 正文 年R本政府宣布巍膘,位于F島的核電站,受9級(jí)特大地震影響芋簿,放射性物質(zhì)發(fā)生泄漏峡懈。R本人自食惡果不足惜,卻給世界環(huán)境...
- 文/蒙蒙 一撩穿、第九天 我趴在偏房一處隱蔽的房頂上張望雾狈。 院中可真熱鬧善榛,春花似錦、人聲如沸味滞。這莊子的主人今日做“春日...
- 文/蒼蘭香墨 我抬頭看了看天上的太陽便脊。三九已至,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間烂琴,已是汗流浹背。 一陣腳步聲響...
- 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像括细,于是被迫代替她去往敵國(guó)和親伪很。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
推薦閱讀更多精彩內(nèi)容
- 新添加判斷iPhone X 、iPhone 8览濒、iPhone 8 Plus 呆盖,恩,應(yīng)該是對(duì)的4选应又!?(^?^*) S...
- 1.手機(jī)系統(tǒng):iPhone OS NSString* phoneVersion = [[UIDevice curr...
- iOS獲取設(shè)備型號(hào)和App版本號(hào)等信息(OC+Swift) 獲取設(shè)備名稱OC代碼 NSString *device...
- #include #include //獲得設(shè)備型號(hào) + (NSString *)getCurrentDevice...