iOS enables you to get the device model which is running your app. In this blog i
would share with everyone how to get the device model by following the below
steps.
Step 1 Add #import<sys/utsname.h> line to your view Controller
Step 2 Add following method to your .m file
1. NSString* ()
2. {
3. struct utsname systemInfo;
4. uname(&systemInfo);
5.
6. return [NSString stringWithCString:systemInfo.machine
7. encoding:NSUTF8StringEncoding];
8. }
Step 3 Now call this method and set return value to string
NSString *deviceInfo = deviceName();
Step 4 This method returns a list from which you will able to see the device
number of your particular device.
1. @"i386" on 32-bit Simulator
2. @"x86_64" on 64-bit Simulator
3. @"iPod1,1" on iPod Touch
4. @"iPod2,1" on iPod Touch Second Generation
5. @"iPod3,1" on iPod Touch Third Generation
6. @"iPod4,1" on iPod Touch Fourth Generation
7. @"iPhone1,1" on iPhone
8. @"iPhone1,2" on iPhone 3G
9. @"iPhone2,1" on iPhone 3GS
10. @"iPad1,1" on iPad
11. @"iPad2,1" on iPad 2
12. @"iPad3,1" on 3rd Generation iPad
13. @"iPhone3,1" on iPhone 4 (GSM)
14. @"iPhone3,3" on iPhone 4 (CDMA/Verizon/Sprint)
15. @"iPhone4,1" on iPhone 4S
16. @"iPhone5,1" on iPhone 5 (model A1428, AT&T/Canada)
17. @"iPhone5,2" on iPhone 5 (model A1429, everything else)
18. @"iPad3,4" on 4th Generation iPad
19. @"iPad2,5" on iPad Mini
20. @"iPhone5,3" on iPhone 5c (model A1456, A1532 | GSM)
21. @"iPhone5,4" on iPhone 5c (model A1507, A1516, A1526 (China),
A1529 | Global)
22. @"iPhone6,1" on iPhone 5s (model A1433, A1533 | GSM)
23. @"iPhone6,2" on iPhone 5s (model A1457, A1518, A1528 (China),
A1530 | Global)
24. @"iPad4,1" on 5th Generation iPad (iPad Air) - Wifi
25. @"iPad4,2" on 5th Generation iPad (iPad Air) - Cellular
26. @"iPad4,4" on 2nd Generation iPad Mini - Wifi
27. @"iPad4,5" on 2nd Generation iPad Mini - Cellular
28. @"iPhone7,1" on iPhone 6 Plus
29. @"iPhone7,2" on iPhone 6
30. @"iPhone8,1" on iPhone 6S
31. @"iPhone8,2" on iPhone 6S Plus
If you have any further doubts, drop us an email at info@infigic.com and we’ll get back to you with the best possible solution. Infigic is a Mobile Application Development Company and we are always there to solve your queries.
would share with everyone how to get the device model by following the below
steps.
Step 1 Add #import<sys/utsname.h> line to your view Controller
Step 2 Add following method to your .m file
1. NSString* ()
2. {
3. struct utsname systemInfo;
4. uname(&systemInfo);
5.
6. return [NSString stringWithCString:systemInfo.machine
7. encoding:NSUTF8StringEncoding];
8. }
Step 3 Now call this method and set return value to string
NSString *deviceInfo = deviceName();
Step 4 This method returns a list from which you will able to see the device
number of your particular device.
1. @"i386" on 32-bit Simulator
2. @"x86_64" on 64-bit Simulator
3. @"iPod1,1" on iPod Touch
4. @"iPod2,1" on iPod Touch Second Generation
5. @"iPod3,1" on iPod Touch Third Generation
6. @"iPod4,1" on iPod Touch Fourth Generation
7. @"iPhone1,1" on iPhone
8. @"iPhone1,2" on iPhone 3G
9. @"iPhone2,1" on iPhone 3GS
10. @"iPad1,1" on iPad
11. @"iPad2,1" on iPad 2
12. @"iPad3,1" on 3rd Generation iPad
13. @"iPhone3,1" on iPhone 4 (GSM)
14. @"iPhone3,3" on iPhone 4 (CDMA/Verizon/Sprint)
15. @"iPhone4,1" on iPhone 4S
16. @"iPhone5,1" on iPhone 5 (model A1428, AT&T/Canada)
17. @"iPhone5,2" on iPhone 5 (model A1429, everything else)
18. @"iPad3,4" on 4th Generation iPad
19. @"iPad2,5" on iPad Mini
20. @"iPhone5,3" on iPhone 5c (model A1456, A1532 | GSM)
21. @"iPhone5,4" on iPhone 5c (model A1507, A1516, A1526 (China),
A1529 | Global)
22. @"iPhone6,1" on iPhone 5s (model A1433, A1533 | GSM)
23. @"iPhone6,2" on iPhone 5s (model A1457, A1518, A1528 (China),
A1530 | Global)
24. @"iPad4,1" on 5th Generation iPad (iPad Air) - Wifi
25. @"iPad4,2" on 5th Generation iPad (iPad Air) - Cellular
26. @"iPad4,4" on 2nd Generation iPad Mini - Wifi
27. @"iPad4,5" on 2nd Generation iPad Mini - Cellular
28. @"iPhone7,1" on iPhone 6 Plus
29. @"iPhone7,2" on iPhone 6
30. @"iPhone8,1" on iPhone 6S
31. @"iPhone8,2" on iPhone 6S Plus
If you have any further doubts, drop us an email at info@infigic.com and we’ll get back to you with the best possible solution. Infigic is a Mobile Application Development Company and we are always there to solve your queries.
Comments
Post a Comment