I've checked whether motion&fitness is enabled in my app. I've checked the below code to check this.
if([CMMotionActivityManager isActivityAvailable])
{
}
This returns FALSE when motion&fitness is disabled in settings. But the motion&fitness option is not there in iPhone 5 and lower versions. So I want to know whether the device model is iPhone 5s or higher. Is there any way to check this?
If you want to check motion then use
https://developer.apple.com/library/prerelease/ios/documentation/CoreMotion/Reference/CMSensorRecorder_class/index.html#//apple_ref/occ/clm/CMSensorRecorder/isAuthorizedForRecording
iOS 9 and above, CMSensorRecorder class, In that they introduce method to check if your app is authorized for Motion & Fitness:
If you are using Swift the use following
class `func isAuthorizedForRecording() -> Bool
if Objective C then
+ (BOOL)isAuthorizedForRecording
if you just want to check device model then use following method
[[UIDevice currentDevice] platformType] // ex: UIDevice4GiPhone
[[UIDevice currentDevice] platformString] // ex: #"iPhone 4G"
to getting complete list of model
#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];
}
after printing device name you will get one of following output
#"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
#"iPhone8,4" on iPhone SE
If you want in Swift please use below link
iOS: How to determine the current iPhone/device model in Swift?
Related
iOS 9.3 was released on march 21, 2016, and according to its download page, this version has two build numbers associated :
Builds
13E233
13E234
I don't remember of any previous iOS version with multiple builds numbers, so it raised some questions :
First, why is there two build numbers ? The builds were made successively according to the difference between them, so maybe there are one iPhone and one iPad build.
What is the difference between these builds ?
How can I detect which build i'm using ?
If you look at the name of each platform's ipsw file, you will see which binaries were build 13E233 or 13E234:
iPhone 6s
iPhone8,1_9.3_13E234_Restore.ipsw
iPhone 6s Plus
iPhone8,2_9.3_13E234_Restore.ipsw
iPhone SE
iPhone8,4_9.3_13E233_Restore.ipsw
iPhone 6
iPhone7,2_9.3_13E233_Restore.ipsw
iPhone 6 Plus
iPhone7,1_9.3_13E233_Restore.ipsw
iPhone 5s (CDMA)
iPhone6,2_9.3_13E233_Restore.ipsw
iPhone 5s (GSM)
iPhone6,1_9.3_13E233_Restore.ipsw
iPhone 5 (CDMA)
iPhone5,2_9.3_13E233_Restore.ipsw
iPhone 5 (GSM)
iPhone5,1_9.3_13E233_Restore.ipsw
iPhone 5c (CDMA)
iPhone5,4_9.3_13E233_Restore.ipsw
iPhone 5c (GSM)
iPhone5,3_9.3_13E233_Restore.ipsw
iPhone 4S
iPhone4,1_9.3_13E233_Restore.ipsw
iPad Pro 12"
iPad6,7_9.3_13E233_Restore.ipsw
iPad Pro 12" (LTE Cellular)
iPad6,8_9.3_13E233_Restore.ipsw
iPad Pro 9" model
iPad6,3_9.3_13E234_Restore.ipsw
iPad Pro 9" model (LTE Cellular)
iPad6,4_9.3_13E234_Restore.ipsw
iPad Air 2
iPad5,3_9.3_13E233_Restore.ipsw
iPad Air 2 (LTE Cellular)
iPad5,4_9.3_13E233_Restore.ipsw
iPad Air (5th generation Cellular)
iPad4,2_9.3_13E233_Restore.ipsw
iPad Air (5th generation)
iPad4,1_9.3_13E233_Restore.ipsw
iPad Air (5th generation China)
iPad4,3_9.3_13E233_Restore.ipsw
iPad (4th generation CDMA)
iPad3,6_9.3_13E233_Restore.ipsw
iPad (4th generation GSM)
iPad3,5_9.3_13E233_Restore.ipsw
iPad (4th generation)
iPad3,4_9.3_13E233_Restore.ipsw
iPad 3 Wi-Fi (3rd generation)
iPad3,1_9.3_13E233_Restore.ipsw
iPad 3 Wi-Fi + Cellular (GSM)
iPad3,3_9.3_13E233_Restore.ipsw
iPad 3 Wi-Fi + Cellular (CDMA)
iPad3,2_9.3_13E233_Restore.ipsw
iPad 2 Wi-Fi (Rev A)
iPad2,4_9.3_13E233_Restore.ipsw
iPad 2 Wi-Fi
iPad2,1_9.3_13E233_Restore.ipsw
iPad 2 Wi-Fi + 3G (GSM)
iPad2,2_9.3_13E233_Restore.ipsw
iPad 2 Wi-Fi + 3G (CDMA)
iPad2,3_9.3_13E233_Restore.ipsw
iPad Mini (CDMA)
iPad2,7_9.3_13E233_Restore.ipsw
iPad Mini (GSM)
iPad2,6_9.3_13E233_Restore.ipsw
iPad Mini
iPad2,5_9.3_13E233_Restore.ipsw
iPad Mini 2 (Cellular)
iPad4,5_9.3_13E233_Restore.ipsw
iPad Mini 2
iPad4,4_9.3_13E233_Restore.ipsw
iPad Mini 2 (China)
iPad4,6_9.3_13E233_Restore.ipsw
iPad Mini 3 (China)
iPad4,9_9.3_13E233_Restore.ipsw
iPad Mini 3
iPad4,7_9.3_13E233_Restore.ipsw
iPad Mini 3 (Cellular)
iPad4,8_9.3_13E233_Restore.ipsw
iPad Mini 4
iPad5,1_9.3_13E233_Restore.ipsw
iPad Mini 4 (Cellular)
iPad5,2_9.3_13E233_Restore.ipsw
iPod touch (5th-generation)
iPod5,1_9.3_13E233_Restore.ipsw
iPod touch (6th-generation)
iPod7,1_9.3_13E233_Restore.ipsw
The binaries that were build 13E234 were for the iPhone 6s, 6s Plus, and iPad Pro 9" devices.
I'm using the below 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 is:
#"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
#"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
#"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
#"iPhone7,1" on iPhone 6 Plus
#"iPhone7,2" on iPhone 6
I got x86_64 always. But I wish to get iphone4 when I select the 4s simulator iPhone6 when I select the iPhone 6 simulator.
Is there any way to achieve this?
I feel a little dummy to ask such a question but I am not sure. Can someone tell me to whichreal device corresponds exactly each device in the simulator? I have seen here that all the devices available in the simulator are the following ones, but to what do they correspond?
iPhone Retina (3.5-inch) :iPhone 4 and 4s?
iPhone Retina (4-inch) : iPhone 5?
iPhone Retina (4-inch 64-bit) : iPhone 5s?
iPad
iPad Retina : iPad 1, 2 or 3?
iPad Retina (64-bit)
All of the iPhone entries you have are correct.
5th gen iPod touch would be under iPhone Retina 4".
4th gen iPod touch would be under iPhone Retina 3.5".
The 3rd gen and earlier would be under iPhone Non-retina 3.5"
The iPad would be:
iPad - iPad 1, iPad 2, 1st gen Mini
iPad Retina - iPad 3, iPad 4,
iPad Retina 64-bit - iPad Air, 2nd gen Mini
I find the Wikipedia page List of iOS devices to be very helpful.
Anyone know the machine IDs for these new devices? For example the 3rd generation iPad could be iPad3,1 iPad3,2, iPad3,5 iPad3,6 depending on the model. I'm finding the string with this
struct utsname systemInfo;
uname(&systemInfo);
NSString *dev = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
I got a new Ipad 4th Wifi, the machine model is iPad3,4
Also, Ipad mini Wifi is iPad2,5
Edited
On Mid-November will be launch the rest of the new Ipad models: (as Ipad 3th gen)
iPad3,5 for iPad 4th gen GSM
iPad3,6 for iPad 4th gen CDMA
iPad2,6 for Ipad mini Wifi GSM
iPad2,7 for Ipad mini Wifi CDMA
Just got my iPad mini. "iPad2,5"
UIDevice model is just "iPad". I suspect the larger iPad 2 will be phased out since it does not have the lighting port, and the new iPad mini Retina will be iPad2,6
I am developing iOS app with ZBar SDK for QR-codes scan. Here ZBar SDK creators tell us that
Only the iPhone 3GS and iPhone 4 are supported, as they have a camera
with auto-focus. The ZBar library does not support the iPhone 3G and
is unlikely to ever support it.
So I have added auto-focus-camera key to the Required Device Capabilities section of my plist. All is great, except one thing - iPad 2 & iPod Touch 4th Gen doesn't have auto focus camera, but still are able to use my ZBar SDK code to scan QR-codes. But my auto-focus-camera key doen't allow users with iPad 2 and iPod Touch 4th Gen to download my app from App Store.
In other words I need to find a way to make my app installable via App Store on these devices:
iPhone 3GS.
iPhone 4.
iPhone 4S.
iPad 2.
The New iPad.
iPod Touch 4th Gen.
And on these devices my app should not be available:
iPhone 2G.
iPhone 3G.
iPad.
iPod Touch 3d Gen and
My question is: how to make my app available in App Store for first list devices' user and not available for second list devices' users?
Any help will be appreciated!
PS: I have seen this question on SO, but it doesn't help me much.
PS2: This app has the desired set of available devices.
Requirements: Compatible with iPhone 3GS, iPhone 4, iPhone 4S, iPod
touch (4th generation), iPad 2 Wi-Fi, iPad 2 Wi-Fi + 3G, iPad (3rd
generation) and iPad Wi-Fi + 4G.
Does anyone know, how they did it?
PS3: At the same time adding both still-camera and auto-focus-camera gives us this:
Requirements: Compatible with iPhone, iPod touch (4th generation),
iPad 2 Wi-Fi, iPad 2 Wi-Fi + 3G, iPad (3rd generation) and iPad Wi-Fi
+ 4G.
And that is not a great way as long as we have all iPhones as suitable for our app, instead of 3GS, 4 and 4S.
PS4: My app is here and it has such requirements:
Requirements: Compatible with iPhone 3GS, iPhone 4, and iPhone 4S.
Word Lens requires the armv7, opengles-2, and video-camera device capabilities.
I'm not sure that you can do that
Maybe you can do a check in your code and if the device model is not the good one, just pop a new view saying that the model that the user is using can't make work the application ?
You can detect the model with this:
#import <sys/utsname.h>
NSString*
machineName()
{
struct utsname systemInfo;
uname(&systemInfo);
return [NSString stringWithCString:systemInfo.machine
encoding:NSUTF8StringEncoding];
}
and give that:
#"i386" on the 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
#"iPhone1,1" on iPhone
#"iPhone1,2" on iPhone 3G
#"iPhone2,1" on iPhone 3GS
#"iPad1,1" on iPad
#"iPad2,1" on iPad 2
#"iPhone3,1" on iPhone 4
#"iPhone4,1" on iPhone 4S
Else you can try sending an e-mail to apple
We need to use video-camera key in Required Device Capabilities section of app's plist.