how do I get the SDK version for an app running on the simulator programmatically?

Posted by newbiez on Stack Overflow See other posts from Stack Overflow or by newbiez
Published on 2012-06-13T01:33:19Z Indexed on 2012/06/13 4:40 UTC
Read the original article Hit count: 145

Filed under:

I am trying to get the version/build that is running on the simulator via code.

Basically I am checking various features of my app using the simulator, and want to switch code paths on and off based on which SDK do I have set as current, instead than doing it by hand every time (my testing machine has different version of the SDK on it and I switch the current for testing purposes between 4.1 and 5.1).

So the idea is that when the app launch on the simulator, I can read the build of the SDK and know trough matching (I have a function that does the matching and turn on and off the features) if I should run a specific code path or not.

I know how to figure out if I am running on the sim or on a device, but cannot find references about how to get the version of the SDK via code, so I am basically stuck.

Is there any function that I can call and that returns me the build or version of the currently installed iOS, while I am running the app on the simulator?

© Stack Overflow or respective owner

Related posts about ios