iOS中需要查詢的裝置號, 型號

2021-07-11 22:37:31 字數 2527 閱讀 1919

網上搜尋出來的,記錄下來以後使用方便:

//手機序列號

nsstring* identifiernumber = [[uidevice currentdevice] uniqueidentifier];

nslog(@"手機序列號: %@",identifiernumber);

//手機別名: 使用者定義的名稱

nsstring* userphonename = [[uidevice currentdevice] name];

nslog(@"手機別名: %@", userphonename);

//裝置名稱

nsstring* devicename = [[uidevice currentdevice] systemname];

nslog(@"裝置名稱: %@",devicename );

//手機系統版本

nsstring* phoneversion = [[uidevice currentdevice] systemversion];

nslog(@"手機系統版本: %@", phoneversion);

//手機型號

nsstring* phonemodel = [[uidevice currentdevice] model];

nslog(@"手機型號: %@",phonemodel );

//地方型號 (國際化區域名稱)

nsstring* localphonemodel = [[uidevice currentdevice] localizedmodel];

nslog(@"國際化區域名稱: %@",localphonemodel );

nsdictionary *infodictionary = [[nsbundle mainbundle] infodictionary];

// 當前應用名稱

// 當前應用軟體版本 比如:1.0.1

// 當前應用版本號碼  int型別

//手機序列號

nsstring* identifiernumber = [[uidevice currentdevice] uniqueidentifier];

nslog(@"手機序列號: %@",identifiernumber);

//手機別名: 使用者定義的名稱

nsstring* userphonename = [[uidevice currentdevice] name];

nslog(@"手機別名: %@", userphonename);

//裝置名稱

nsstring* devicename = [[uidevice currentdevice] systemname];

nslog(@"裝置名稱: %@",devicename );

//手機系統版本

nsstring* phoneversion = [[uidevice currentdevice] systemversion];

nslog(@"手機系統版本: %@", phoneversion);

//手機型號

nsstring* phonemodel = [[uidevice currentdevice] model];

nslog(@"手機型號: %@",phonemodel );

//地方型號 (國際化區域名稱)

nsstring* localphonemodel = [[uidevice currentdevice] localizedmodel];

nslog(@"國際化區域名稱: %@",localphonemodel );

nsdictionary *infodictionary = [[nsbundle mainbundle] infodictionary];

// 當前應用名稱

// 當前應用軟體版本 比如:1.0.1

// 當前應用版本號碼  int型別

結果:2012-10-19 14:07:47.622 mydemo[5779:707] 手機序列號: 6685c75e34104be0b04c6ceb72985dc381f0f746

2012-10-19 14:07:47.624 mydemo[5779:707] 手機別名: 「spring sky」的 ipod

2012-10-19 14:07:47.627 mydemo[5779:707] 裝置名稱: iphone os

2012-10-19 14:07:47.629 mydemo[5779:707] 手機系統版本: 5.1.1

2012-10-19 14:07:47.641 mydemo[5779:707] 手機型號: ipod touch

2012-10-19 14:07:47.642 mydemo[5779:707] 國際化區域名稱: ipod touch

2012-10-19 14:07:47.643 mydemo[5779:707] 當前應用名稱:mydemo

2012-10-19 14:07:47.645 mydemo[5779:707] 當前應用軟體版本:1.0.1

2012-10-19 14:07:47.646 mydemo[5779:707] 當前應用版本號碼:101

更準確的獲取iOS裝置型號

注意加標頭檔案 import sys utsname.h 加入了檢測系統裝置型號 pragma mark 檢測系統裝置型號 ios 獲取最新裝置型號方法 列表最新對照表 如果出了新裝置,可以在上面的鏈結找到對應的 nsstring getdeviceversioninfo nsstring corr...

獲取iOS裝置型號的方法總結

三種常用的辦法獲取ios裝置的型號 1.uidevice currentdevice model 推薦 2.uname struct utsname name 使用此函式需要 include 3.sysctlbyname const char name,void oldp,size t oldlen...

獲取iOS裝置型號的方法總結

三種常用的辦法獲取ios裝置的型號 1.uidevice currentdevice model 推薦 2.uname struct utsname name 使用此函式需要 include 3.sysctlbyname const char name,void oldp,size t oldlen...