Swift 2.0 Minimum Target on Mac OS

I'm trying to find the minimum possible deployment target for Swift 2.0 apps on Mac OS. I've seen a few answers to the question for iOS but not for the Mac. Can anybody shed light on this? Thanks!

Accepted Reply

iOS 7 / OS X 10.9, same as Swift 1.0.

Replies

iOS 7 / OS X 10.9, same as Swift 1.0.

Thanks!

I tried creating a new Cocoa project in Xcode 7.0 running on Yosemite 10.10.5 today and couldn't compile when setting the "Base SDK" to 10.10. I had manually added the OS X 10.10 SDK that I took from my Xcode 6 install inside my Xcode.app bundle in order to be able to set this.

The error message I get is the following: "<unknown>:0: error: Swift does not support the SDK 'MacOSX10.10.sdk'". Are you sure OS X 10.9 and 10.10 support Swift 2.0?

You should set the Deployment Target (under Deployment Info in the General tab of your project) to the earliest OS version you support (e.g. 10.9), and set the base SDK to the latest OS version you support (10.11).

Doing so made the application non functional on several of my friend's computers running 10.10.2 to 10.10.3 (error message saying the application doesn't support his version of OS X). I haven't tested on an other computer running 10.10.5 but I suspect a similar behavior and I would like to support 10.10.0+

I created a simple samle code using Xcode 7 on Yosemete 10.10.5, Base SDK 10.11 and Deployment Target 10.10.


The app run with no problems on 10.10.2.


I'm afraid your code contains some functionalities which are not available in 10.10.2 or 10.10.3, or other settings may be wrong, or you completely broke your Xcode doing `I had manually added the OS X 10.10 SDK that I took from my Xcode 6 install inside my Xcode.app bundle`.

I didn't break my Xcode since I've been working with it on my computer without any problems. I think the most probable reason would be that I'm using functionalities unavailable on systems with OS X < 10.10.5. Is there a reference I can check to see what's new in 10.10.4 or 10.10.5 ? I thought the SDK was for all versions of OS X 10.10...

Some functionalites are only available in 10.10.3 or later (found in OS X Yosemite v10.10.3), but if you use such features in a project targeting 10.10, you'll get an avaiability error from Swift. Till now, I couldn't have succeeded to create an app which causes runtime error reporting `the application doesn't support his version of OS X`.

Okay I looked up the changes in 10.10.3 and I'm using none of those in my project, explaining why I don't get the availability error from Swift. Still, it doesn't explain why my friends on 10.10.2 and 10.10.3 can't open the signed App, even though my LSMinimumSystemVersion is set to 10.10.. What a headache.

If I have sub-projects that generate frameworks (i.e. Alamofire), do they need to have a LSMinimumSystemVersion in their Info.plist?

I have never used any of third party framworks, so I cannot say anything about it.

I just can say that the app built with the settings above runs very well even if I rewrite LSMinimumSystemVersion manually to `10.10.`.

Consider the following empty project created with Xcode 7 (File -> New -> Project -> Cocoa Application in Swift) : https://dl.dropboxusercontent.com/u/12734895/Test.zip

It has a deployment target of 10.10 and SDK of 10.11. The generated app bundle is available here : https://dl.dropboxusercontent.com/u/12734895/Test.app.zip


The app works fine on my computer, no problem whatsoever, the app opens a blank window as it should.


When giving this to a person whose computer doesn't have developer tools installed, the application crashes as seen on this screenshot (it's in French sorry) even on 10.10.5: https://dl.dropboxusercontent.com/u/12734895/testerror.jpg

I took that app, changed the code signing identity, built it with Xcode 7, copied the result to a 10.10 (virtual) machine without developer tools, and ran it. It worked just fine.

Can you get a crash from the user who is having problems? It might give you some hints as to what’s going wrong.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

All the same. Downloaded the project, touched only code signing identity (I'm sure I haven't touched any other settings), built with Xcode 7 and moved to 10.10.2 Mac, it opened an empty windows.


Directly downloaded your Test.app and tried to run it. It showed exactly the same dialog (though mine was in Japanese) and stopped.

Detailed information contains this line:

Exception Type: EXC_CRASH (Code Signature Invalid)

Sorry for the trouble, I managed to make my app work on Yosemite, I had an included framework with a static Install path that was making the app crash. No idea why my test project was force closing though, but it doesn't matter anymore 🙂