Oliver
Oliver

Reputation: 23550

iPhone - How to determine the deployment target iOS version of an existing project

I have an existing huge iOS project, set for iOS 5.0 target by default. But I'm pretty sure that it is also 4.?.? compliant.

How may I know the minimum iOS version my app can be targeted to, without having to compare the whole code word by word with the iOS documentation to know for each method/constant/... the iOS version it was introduced, and at the end, know what minimum iOS version I can target ? That would take weeks !

(XCode does not help... Setting the iOS target to something lower that iOS 5 never raises any warning nor error when compiling, so I don't know for example, which methods are only available for iOS 4.2 when setting target version to iOS 4.1...)

Upvotes: 4

Views: 3106

Answers (2)

Nick Lockwood
Nick Lockwood

Reputation: 41005

If you've used any iOS 5 APIs then the app will crash when that code tries to execute on iOS 4.x unless you put in some code to check that the methods are available before calling them (look up "respondsToSelector:" in the documentation).

Set your deployment target to iOS 4.3. In the simulator, in the top-left drop down it should offer you a choice of iOS 5 or 4.3 simulators. Select 4.3, then test your app thoroughly, if it crashes you can check the console log to find the offending API call and then work out what to do about it.

If you can't see 4.3 in the build dropdown then you must have still got 5.0 as your deployment target.

I suggest not setting the deployment target any earlier than 4.3 unless you have a test device running an earlier OS that you can use.

So the answer to your question is, the deployment target should be the earliest version of iOS that you are able to test the app on (either with the simulator or an actual device), unless you rely on APIs in later OS versions and can't work around them.

Upvotes: 2

Ali3n
Ali3n

Reputation: 1244

In the build setting of your target , you can search for the deployment target. That will give you the information about the minimum version of iOS for which this app was developed.

Upvotes: 0

Related Questions