識別 判斷 iOS裝置 資訊

來源:互聯網
上載者:User

標籤:


 

EITHER try this library: http://github.com/erica/uidevice-extension/ (by Erica Sadun).


 

(Sample Code):


 
[[UIDevice currentDevice] platformType]   // ex: UIDevice4GiPhone[[UIDevice currentDevice] platformString] // ex: @"iPhone 4G"

 

OR You can use this method:


 

You can get the device model number using uname from sys/utsname.h. For example:


 

 




[[UIDevice currentDevice] platformType]
// ex: UIDevice4GiPhone[[UIDevice currentDevice] platformString] // ex: @"iPhone 4G"OR You can use this method: #import <sys/utsname.h> // import it in your header or implementation file.NSString* deviceName(){ struct utsname systemInfo; uname(&systemInfo); return [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];}The result should be:@"i386" on 32-bit Simulator@"x86_64" on 64-bit Simulator@"iPod1,1" on iPod Touch@"iPod2,1" on iPod Touch Second Generation@"iPod3,1" on iPod Touch Third Generation@"iPod4,1" on iPod Touch Fourth Generation@"iPod7,1" on iPod Touch 6th Generation@"iPhone1,1" on iPhone@"iPhone1,2" on iPhone 3G@"iPhone2,1" on iPhone 3GS@"iPad1,1" on iPad@"iPad2,1" on iPad 2@"iPad3,1" on 3rd Generation iPad@"iPhone3,1" on iPhone 4 (GSM)@"iPhone3,3" on iPhone 4 (CDMA/Verizon/Sprint)@"iPhone4,1" on iPhone 4S@"iPhone5,1" on iPhone 5 (model A1428, AT&T/Canada)@"iPhone5,2" on iPhone 5 (model A1429, everything else)@"iPad3,4" on 4th Generation iPad@"iPad2,5" on iPad Mini@"iPhone5,3" on iPhone 5c (model A1456, A1532 | GSM)@"iPhone5,4" on iPhone 5c (model A1507, A1516, A1526 (China), A1529 | Global)@"iPhone6,1" on iPhone 5s (model A1433, A1533 | GSM)@"iPhone6,2" on iPhone 5s (model A1457, A1518, A1528 (China), A1530 | Global)@"iPad4,1" on 5th Generation iPad (iPad Air) - Wifi@"iPad4,2" on 5th Generation iPad (iPad Air) - Cellular@"iPad4,4" on 2nd Generation iPad Mini - Wifi@"iPad4,5" on 2nd Generation iPad Mini - Cellular@"iPad4,7" on 3rd Generation iPad Mini - Wifi (model A1599)@"iPhone7,1" on iPhone 6 Plus@"iPhone7,2" on iPhone 6@"iPhone8,1" on iPhone 6S@"iPhone8,2" on iPhone 6S Plus

來自

http://stackoverflow.com/questions/11197509/ios-how-to-get-device-make-and-model

識別 判斷 iOS裝置 資訊

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.