Xcode compatibility deprecation? - xcode

I've run several tests with Xcode 5.1, 6.4, 7.0 and various macOS versions and noticed it's not forward compatible as expected, and this behavior is not documented anywhere AFAIK.
Xcode 5.1 is compatible up to OS X 10.11
Xcode 6.4 is compatible up to macOS 10.12
Xcode 7.0 is compatible up to macOS 10.13
It seems that Apple purposely disable Xcode on newer macOS to force updates, but I don't see the reason. It's not visible in Xcode's plist either.
This mean I can't have a fixed set of development tool if I upgrade my OS, while I can still run very old versions of Visual Studio on newer versions of Windows for instance.
Why that, and is there any documentation of that behavior?

Apple and Microsoft have very different philosophies on how to handle forward and backward compatibility. As a general rule, each major version of Apple's Xcode environment in recent years has been capable of running only on the OS that it was released with and one or two versions of the macOS that follow (for example, as you point out, Xcode 7 will still run on 10.13).
Generally speaking, if you are going to be developing new features and functions for a macOS (or iOS) application, Apple encourages you to use the latest SDK and then take advantage of the Xcode Deployment Target mechanism as well as some of the OS- and language-specific tools, such as #available, to help you write code that will run on both new and older versions of the OS, using the same code base.
You may agree or disagree with this philosophy, but it is how Apple views their ecosystem.
In practice, if you are continuing to develop (or support) using the older SDKs, it is useful to maintain build and test environments that are native to the older versions SDKs. This can be done on dedicated hardware or using virtualization tools. However, in many cases, it is possible to pull code forward to newer versions of the tools by using the Deployment Target settings, thereby allowing you to maintain a single code base that retains compatibility with older iOS/macOS, but also avails you of the latest tools and features in the newer versions.
In our case, we tend to try to move forward along with the platform SDKs as quickly as possible. For our iOS work, that generally means updating the SDK release with the new iOS every year, and thus upgrading our compiler chain. For our macOS product, we have maintained backward compatibility with much older versions (since the adoption of new macOS tends to be slower than new iOS), which means that we currently have development and test environments for Xcode 7.x and Xcode 9.x. Due to specific changes in the Xcode 7-Xcode 8 timeframe (related to QuickTime) we cannot use just the Deployment Target to maintain our oldest compatibility without the older Xcode. In the near future, we'll make the decision to drop support for older macOS versions and move to using our Xcode 9-only as our basis.

Related

What is the difference between CommandLineTools, MacosSDK and XCode?

My main confusion comes from these products seem to each have their own release versions and sometimes, these versions get mixed up and thus, making it very hard to know which version of build tools you are using.
Xcode is Apple's app for making apps for Apple's platforms: macOS, iOS, tvOS, and watchOS. Each version of Xcode ships with a version of the SDK for Apple's platforms, including macOS. The site Xcode Releases shows the SDKs that ship with each version of Xcode.
The Command Line Tools package is for people who want access to compilers and other developer tools but don't need Xcode. If you have Xcode installed, you don't need to install the Command Line Tools package because it's part of the Xcode installation.
I'm not sure what is confusing you. I looked at Apple's downloads site, and each version of Xcode has a corresponding Command Line Tools package. You may want to edit your question and add more details as to what's confusing you.

How to choose Xcode version, SDK and toolchain to develop for Mac OS X?

Recently I installed mac OS Mojave. Now I starts my way with Xcode. So I have an application for which I use Qt5.5.1, this version was build with deployment 10.7 and sdk 10.10. Also I have another Objective-C application which was build with deployment 10.7 and sdk 10.11. I need to build both apps for minimum Mac OS X 10.7 version with any later versions supported. It is situation. Now questions:
There is a any difference which Xcode use to build?
Which version Xcode is optimal as IDE? AppStore has very negative rating for latest.
There is a any difference which toolchain use? Or I always should use one provided with Xcode?
Should I use the same SDK as SDK used in base library? Or it is free to use latest?
It is ok to use foreign SDK not provided with installed Xcode version?
Now I can build the both applications with latest Xcode and SDK 10.11. Seems no any problem. But I want to be sure that will no any problems to run and use on 10.7. And want to know correct way to decide which Xcode/SDK and when should to use?
P.S. Applications for PC only, no need any iOS support.
You should use the most recent version of Xcode that will run on your Mac and the SDK that ships with that version. Currently the most recent version of Xcode is 10.1, which ships with the macOS 10.14 SDK. By using the 10.14 SDK your app can take advantage of the features introduced in macOS 10.14, such as dark mode. If you build your app with the 10.11 SDK, your app won't be able to take advantage of anything Apple added in 10.12, 10.13, and 10.14. For one thing your app won't look good in dark mode on 10.14.
To support 10.7 in your app, you must set the deployment target for your project to 10.7. The deployment target is the earliest OS version your app supports. You also have to make sure your app doesn't use any technologies or call any functions that were added after 10.7. That means no storyboards, no Swift, and no base internationalization for localizing your app to other spoken languages. Making sure your app uses only things that are available in macOS 10.7 is not easy. That is why many apps support only the most recent version of macOS and 1-2 previous versions.

Xamarin: error MT1108: Could not find developer tools for this 11.0.3 (15A432) device

I started to have this issue once I upgraded my phone to iOS 11.0.3.
It seems that now Visual Studio Community Edition for Mac (v7.2 build 636)
I've tried with both with XCode v9.0 (9A235) and v9.0.1 (9A1004)
This is the error that I receive in the application output in Visual Studio for Mac:
"error MT1108: Could not find developer tools for this 11.0.3 (15A432) device. Please ensure you are using a compatible Xcode version and then connect this device to Xcode to install the development support files."
I've verified that the path is set correctly for xcode-select, so in theory, it should work correctly. I'm almost thinking that the Xamarin toolchain does not yet support iOS v11.0.3
I've also tried deleting the bin/obj folders to no avail.
Might anyone be able to confirm that the Xamarin toolchain is compatible with iOS v11.0.3, and if so are there any special steps that need to be taken to make the toolchain recognize the version?
I can potentially downgrade my device to v11.0.1, but before I do I'd like to know if the toolchain is indeed incompatible.
Please let me know if there is more information that I can provide.
Apple ships some extra development code for devices when it release Xcode (an additional disk image to be loaded by the operating system).
In general Xcode ships them for everything it support at that point of time. Which means that when a newer version of iOS is shipped after the Xcode release the missing disk image might be unavailable until an updated Xcode is released (Apple can't guarantee future compatibility of the disk image).
E.g. for Xcode 9.0 (I don't have 9.0.1 installed)
/Applications/Xcode9.app/Contents//Developer/Platforms/iPhoneOS.platform/DeviceSupport/11.0 (15A372)/DeveloperDiskImage.dmg
Xamarin.iOS tries to load the image based on the device version. If it cannot find it it will report the MT1108 error. A potential workaround would be to rename (or copy) the disk image to match your iOS version number. YMMV depending on the changes that Apple introduced in that iOS update.
Note that Xamarin.iOS does not need the disk image for most features. The most visible one, where it's required, is to automatically start the application on devices.
As you found out the deployment works and you can manually start the application and the debugger will connect. I'll update the documentation to include this information.
Update
There was no further Xcode 9.0.x release after iOS 11.0.3. However the next Xcode release (9.1) included support for all 11.0.x versions.
/Applications/Xcode91.app/Contents//Developer/Platforms/iPhoneOS.platform/DeviceSupport/11.0/DeveloperDiskImage.dmg
The shasum of both images are identical so you can assume the one from Xcode9.0 could be renamed/copied without any issue.
Navigate to project folder and delete folders named bin & obj. That should fix the problem.

Can I run project on older version of Xcode and iOS Simulator

Is it possible to run project from the newest version of XCode on an older version of XCode (older Mac with older XCode and iOS Simulator)?
It really depends. Storyboards will have trouble on older versions of Xcode as they are updated regularly. Some other new features may be a problem too, it really depends on your project.
You can download old simulators in the current Xcode from: Preferences > Downloads and then in components, but it doesn't go back very far, at the time of writing as far as iOS 7.1.
If your Mac is too old to run current Xcode/Yosemite you probably do need to upgrade your Mac sooner or later I'm afraid.

Xcode side-by-side install. Is it fine to use?

Xcode offers side-by-side install. However, I haven't tried it but now I'm being pressured to test the new beta SDK (for future projects) while keeping my current SDK environment (for current production). So I'm considering a side-by-side install.
Currently Xcode 4 is not stable enough, but before to install, I want to know possible issues with a side-by-side installation. I'm preparing Xcode 3.x (legacy) and Xcode 4.2 (beta) addition to current 4.0.x.
You shouldn't have any difficulties. I've been running side-by-side installations of Xcode for years now, no problems.
Helpful hint: Modify the icons for the different Xcode installations to differentiate between SDK versions. Mixing up beta and production environments has caused issues for me in the past. Cached link to my post on the subject, since my blog is currently down.

Resources