獲取設備型號 iPhone X iPhone 8等

-?(NSString?*)getDeviceName

{

//?需要#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?(GSM+CDMA)";

if([deviceString?isEqualToString:@"iPhone5,3"])return@"iPhone?5c?(GSM)";

if([deviceString?isEqualToString:@"iPhone5,4"])return@"iPhone?5c?(GSM+CDMA)";

if([deviceString?isEqualToString:@"iPhone6,1"])return@"iPhone?5s?(GSM)";

if([deviceString?isEqualToString:@"iPhone6,2"])return@"iPhone?5s?(GSM+CDMA)";

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";

//?日行兩款手機型號均為日本獨占趁啸,可能使用索尼FeliCa支付方案而不是蘋果支付

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?7?Plus";

if([deviceString?isEqualToString:@"iPhone10,1"])return@"國行(A1863)图甜、日行(A1906)iPhone?8";

if([deviceString?isEqualToString:@"iPhone10,4"])return@"美版(Global/A1905)iPhone?8";

if([deviceString?isEqualToString:@"iPhone10,2"])return@"國行(A1864)、日行(A1898)iPhone?8?Plus";

if([deviceString?isEqualToString:@"iPhone10,5"])return@"美版(Global/A1897)iPhone?8?Plus";

if([deviceString?isEqualToString:@"iPhone10,3"])return@"國行(A1865)囚灼、日行(A1902)iPhone?X";

if([deviceString?isEqualToString:@"iPhone10,6"])return@"美版(Global/A1901)iPhone?X";

if([deviceString?isEqualToString:@"iPod1,1"])return@"iPod?Touch?1G";

if([deviceString?isEqualToString:@"iPod2,1"])return@"iPod?Touch?2G";

if([deviceString?isEqualToString:@"iPod3,1"])return@"iPod?Touch?3G";

if([deviceString?isEqualToString:@"iPod4,1"])return@"iPod?Touch?4G";

if([deviceString?isEqualToString:@"iPod5,1"])return@"iPod?Touch?(5?Gen)";

if([deviceString?isEqualToString:@"iPad1,1"])return@"iPad";

if([deviceString?isEqualToString:@"iPad1,2"])return@"iPad?3G";

if([deviceString?isEqualToString:@"iPad2,1"])return@"iPad?2?(WiFi)";

if([deviceString?isEqualToString:@"iPad2,2"])return@"iPad?2";

if([deviceString?isEqualToString:@"iPad2,3"])return@"iPad?2?(CDMA)";

if([deviceString?isEqualToString:@"iPad2,4"])return@"iPad?2";

if([deviceString?isEqualToString:@"iPad2,5"])return@"iPad?Mini?(WiFi)";

if([deviceString?isEqualToString:@"iPad2,6"])return@"iPad?Mini";

if([deviceString?isEqualToString:@"iPad2,7"])return@"iPad?Mini?(GSM+CDMA)";

if([deviceString?isEqualToString:@"iPad3,1"])return@"iPad?3?(WiFi)";

if([deviceString?isEqualToString:@"iPad3,2"])return@"iPad?3?(GSM+CDMA)";

if([deviceString?isEqualToString:@"iPad3,3"])return@"iPad?3";

if([deviceString?isEqualToString:@"iPad3,4"])return@"iPad?4?(WiFi)";

if([deviceString?isEqualToString:@"iPad3,5"])return@"iPad?4";

if([deviceString?isEqualToString:@"iPad3,6"])return@"iPad?4?(GSM+CDMA)";

if([deviceString?isEqualToString:@"iPad4,1"])return@"iPad?Air?(WiFi)";

if([deviceString?isEqualToString:@"iPad4,2"])return@"iPad?Air?(Cellular)";

if([deviceString?isEqualToString:@"iPad4,4"])return@"iPad?Mini?2?(WiFi)";

if([deviceString?isEqualToString:@"iPad4,5"])return@"iPad?Mini?2?(Cellular)";

if([deviceString?isEqualToString:@"iPad4,6"])return@"iPad?Mini?2";

if([deviceString?isEqualToString:@"iPad4,7"])return@"iPad?Mini?3";

if([deviceString?isEqualToString:@"iPad4,8"])return@"iPad?Mini?3";

if([deviceString?isEqualToString:@"iPad4,9"])return@"iPad?Mini?3";

if([deviceString?isEqualToString:@"iPad5,1"])return@"iPad?Mini?4?(WiFi)";

if([deviceString?isEqualToString:@"iPad5,2"])return@"iPad?Mini?4?(LTE)";

if([deviceString?isEqualToString:@"iPad5,3"])return@"iPad?Air?2";

if([deviceString?isEqualToString:@"iPad5,4"])return@"iPad?Air?2";

if([deviceString?isEqualToString:@"iPad6,3"])return@"iPad?Pro?9.7";

if([deviceString?isEqualToString:@"iPad6,4"])return@"iPad?Pro?9.7";

if([deviceString?isEqualToString:@"iPad6,7"])return@"iPad?Pro?12.9";

if([deviceString?isEqualToString:@"iPad6,8"])return@"iPad?Pro?12.9";

if([machineString?isEqualToString:@"iPad6,11"])return@"iPad?5?(WiFi)";

if([machineString?isEqualToString:@"iPad6,12"])return@"iPad?5?(Cellular)";

if([machineString?isEqualToString:@"iPad7,1"])return@"iPad?Pro?12.9?inch?2nd?gen?(WiFi)";

if([machineString?isEqualToString:@"iPad7,2"])return@"iPad?Pro?12.9?inch?2nd?gen?(Cellular)";

if([machineString?isEqualToString:@"iPad7,3"])return@"iPad?Pro?10.5?inch?(WiFi)";

if([machineString?isEqualToString:@"iPad7,4"])return@"iPad?Pro?10.5?inch?(Cellular)";

if([deviceString?isEqualToString:@"AppleTV2,1"])return@"Apple?TV?2";

if([deviceString?isEqualToString:@"AppleTV3,1"])return@"Apple?TV?3";

if([deviceString?isEqualToString:@"AppleTV3,2"])return@"Apple?TV?3";

if([deviceString?isEqualToString:@"AppleTV5,3"])return@"Apple?TV?4";

if([deviceString?isEqualToString:@"i386"])return@"Simulator";

if([deviceString?isEqualToString:@"x86_64"])return@"Simulator";

returndeviceString;

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末骆膝,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子啦撮,更是在濱河造成了極大的恐慌谭网,老刑警劉巖,帶你破解...
    沈念sama閱讀 206,214評論 6 481
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件赃春,死亡現(xiàn)場離奇詭異愉择,居然都是意外死亡,警方通過查閱死者的電腦和手機织中,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 88,307評論 2 382
  • 文/潘曉璐 我一進店門锥涕,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人狭吼,你說我怎么就攤上這事层坠。” “怎么了刁笙?”我有些...
    開封第一講書人閱讀 152,543評論 0 341
  • 文/不壞的土叔 我叫張陵破花,是天一觀的道長。 經(jīng)常有香客問我疲吸,道長座每,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 55,221評論 1 279
  • 正文 為了忘掉前任摘悴,我火速辦了婚禮峭梳,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘蹂喻。我一直安慰自己葱椭,他們只是感情好,可當我...
    茶點故事閱讀 64,224評論 5 371
  • 文/花漫 我一把揭開白布口四。 她就那樣靜靜地躺著孵运,像睡著了一般。 火紅的嫁衣襯著肌膚如雪蔓彩。 梳的紋絲不亂的頭發(fā)上掐松,一...
    開封第一講書人閱讀 49,007評論 1 284
  • 那天踱侣,我揣著相機與錄音,去河邊找鬼大磺。 笑死抡句,一個胖子當著我的面吹牛,可吹牛的內(nèi)容都是我干的杠愧。 我是一名探鬼主播待榔,決...
    沈念sama閱讀 38,313評論 3 399
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼流济!你這毒婦竟也來了锐锣?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 36,956評論 0 259
  • 序言:老撾萬榮一對情侶失蹤绳瘟,失蹤者是張志新(化名)和其女友劉穎雕憔,沒想到半個月后,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體糖声,經(jīng)...
    沈念sama閱讀 43,441評論 1 300
  • 正文 獨居荒郊野嶺守林人離奇死亡斤彼,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 35,925評論 2 323
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了蘸泻。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片琉苇。...
    茶點故事閱讀 38,018評論 1 333
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖悦施,靈堂內(nèi)的尸體忽然破棺而出并扇,到底是詐尸還是另有隱情,我是刑警寧澤抡诞,帶...
    沈念sama閱讀 33,685評論 4 322
  • 正文 年R本政府宣布穷蛹,位于F島的核電站,受9級特大地震影響昼汗,放射性物質(zhì)發(fā)生泄漏肴熏。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 39,234評論 3 307
  • 文/蒙蒙 一乔遮、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧取刃,春花似錦蹋肮、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,240評論 0 19
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至崩侠,卻和暖如春漆魔,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 31,464評論 1 261
  • 我被黑心中介騙來泰國打工改抡, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留矢炼,地道東北人。 一個月前我還...
    沈念sama閱讀 45,467評論 2 352
  • 正文 我出身青樓阿纤,卻偏偏與公主長得像句灌,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子欠拾,可洞房花燭夜當晚...
    茶點故事閱讀 42,762評論 2 345

推薦閱讀更多精彩內(nèi)容