Friday, March 15, 2013

Deploymate 1.0

Xcode used to let you target an older version of Mac OS X by configuring your project to use that OS’s SDK. For example, you could develop on 10.6 while deploying for 10.4. If you used any APIs that were not available in 10.4, Xcode would report a compilation error. Recent versions of Xcode have essentially removed this functionality because Xcode now only supports the SDK for the previous version of the operating system. For example, Mac OS X 10.8 is the current version, so Xcode only includes an SDK for 10.7. Too bad if you want to target 10.6. And, presumably, Xcode will soon ship with support for pre-release versions of 10.9, dropping SDK support for 10.7.

Apple engineers like to point out that Xcode still lets you set the deployment target to older versions such as 10.6, but in practice this is error-prone because Xcode will never tell you when you are using an API that isn’t available on that version. You won’t find out until you run the app on the older OS and actually exercise the code path that calls the API. Then it will crash.

Deploymate promises to solve this problem (via Matt Drance). It can analyze an Xcode project and tell you whether you’re calling APIs that are not available. Unfortunately, there is currently no way to tell it to ignore calls where you know what you’re doing, e.g. if you’ve conditionalized the call. It may be possible to outsmart its analysis in such cases, however. Even with this limitation, Deploymate looks to be an invaluable addition to my toolkit.

The developer tried to make Deploymate available via the Mac App Store but was thwarted by sandbox issues.

Update (2013-05-05): Jeff Johnson shows how to do something similar with a prefix header.

1 Comment RSS · Twitter

Leave a Comment