How to get iOS Version on the Device

Does anyone know if there’s a way to get the specific version of iOS that’s installed on the device? I’ve tried SystemInfo.operatingSystem, but it just gives me a long string of hex data, such as:

“Operating system is: da06126e9563895ea61…”

Perhaps there is some way to decode this string? Or some other API…?

Thanks!

Mal

look at the iphone utilities class

the systeminfo / general .net functionality won’t do anything good

http://unity3d.com/support/documentation/ScriptReference/iPhoneSettings-generation.html

iPhoneSettings.generation

http://unity3d.com/support/documentation/ScriptReference/iPhoneSettings-systemName.html

iPhoneSettings.systemName

Guys,

Thanks for the suggestions! Unfortunately, no dice. iPhoneUtils doesn’t contain any version related information. iPhoneSettings.generation tells me what kind of hardware I’m running. iPhoneSettings.systemName, which seemed promising, simply contains the string “iPhone OS”. What I need is to be able to determine is if the iOS level is 4.2 or greater.

I also tried System.Environment.OSVersion, but, as Dreamora suspected, that was not useful. It simply contains the string “Unix”.

Any other suggestions? I’m guessing there’s a way to get this through a native iOS API…

Cheers,
Mal

Well, it seems iPhoneSettings.systemVersion is exactly what I want. It yields a string like “4.2.1”.

This class variable is undocumented and shows up in MonoDevelop with a strikethrough line and the tooltip “Obsolete”. I’m not sure what this means. I did find that the equivalent UIDevice variable is used in AppController.mm to determine version level, so presumably it’s not too obsolete.

Cheers,
Mal

iPhoneSettings seems like it’s gone in Unity 4.3+. the iPhone class exists, but can only give you device type, not OS type. Seems the correct way now is SystemInfo.operatingSystem Unity - Scripting API: SystemInfo.operatingSystem

UIDevice gets you what you need.
http://u3dxt.com/api/html/Properties_T_U3DXT_iOS_Native_UIKit_UIDevice.htm

It’s a direct mirror of the official iOS SDK class.

It’s part of the U3DXT IOS SDK Plugin.

iOS.Device.systemVersion ?

2 Likes