Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Build an Application compatible with older MacOS with Xcode?

I just installed the latest version of Xcode (10.1) on MacOS 10.14 (Mojave). I can build my application and it runs fine on my Mac or similar system.

However, I want to share this application with someone using MacOS 10.11 (El Capitan) and it fails to launch, asking for a minimum requirement of MacOS 10.13 (High Sierra).

My application is only very simple, can't I compile it to be compatible with older MacOS ?


After some research, I did download MacOSX10.11.sdk (from https://github.com/phracker/MacOSX-SDKs/releases/). I did decompress it, and drag it into: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs (This folder originally contains only "MacOSX.sdk" and a link pointing to it, named "MacOSX10.14.sdk")

MacOS SDK folder in Xcode

I also noticed the value of the string "MinimumSDKVersion" from the file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist is equal to "10.11", which sounds good in my case.

I read on some forums adding additional SDK versions into Xcode is not supported. And by the way, I cannot see any menu from Xcode to specify my target build (neither in Xcode Preferences, nor in the project settings (see picture below).

enter image description here

Where can I tell Xcode to use, let's say "MacOSX10.11.sdk" over "MacOSX10.14.sdk"?

And, is there a better way?

Or, do I have to install an old version of MacOS on a different partition, with an old version of Xcode (which would be a pain)?

like image 543
Yoric Avatar asked Dec 15 '18 06:12

Yoric


People also ask

Do I need the latest macOS for Xcode?

Xcode can't be installed on because OS X version 10.12 or later is required. OS X Version 10.12. 1 can't be installed because OS X Version 10.12 is required. OS X Update is not found in the App Store.

Can you build macOS apps with Swift?

Set the interface to SwiftUI, the life cycle to SwiftUI App, and the language to Swift, and then click Finish. Set the scheme to MacLandmarks > My Mac. By setting the scheme to My Mac, you can preview, build, and run the macOS app.

Can Xcode run on macOS Catalina?

The latest version of Xcode you can run on Catalina (10.15. 4) is Xcode 12.4 and Command Line Tools 12.4. Show activity on this post. Older Xcode versions are also listed on the Apple Developer site developer.apple.com/download/all However, there the downloads do not mention OS version they support.


Video Answer


1 Answers

I am not sure if this still works on Mojave, but there is a project called XcodeLegacy which is created specifically with this intention in mind: https://github.com/devernay/xcodelegacy

like image 76
reukiodo Avatar answered Oct 14 '22 05:10

reukiodo