What is the difference between CommandLineTools, MacosSDK and XCode? - 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.

Related

Xcode compatibility deprecation?

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.

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.

Xcode OSX SDK is more current than my OS

I am running OSX 10.10.5.
When I create a new Xcode command line project for OSX, the Base SDK is for 10.11. This doesn't seem to matter, as I can still run and archive and use the command line tool.
Today I used CMake to generate an Xcode project from a third-party library. When I open it, it also shows a Base SDK for 10.11. However, unlike my little command-line tool, when I run it, I get the message:
However, there are no other SDKs shown when I inspect the Xcode.app SDK directory, nor are there other options in the Base SDK field in Xcode.
My 2-part question:
1) Why does my own command-line tool not do this, but this third-party Xcode project does, when both have the same SDK listed?
2) How can I get a 10.10.5 SDK into my Xcode, or can't I?
The relevant setting is not the SDK, which governs the maximum level of features your app can use. It's the deployment target, which governs the minimum OS supported by your app.
Your App_HelloWorld target is apparently configured with a deployment target of 10.11. Change that to 10.10 or, perhaps, earlier. However, you have to be careful to either avoid any APIs that require a later version of the OS or do run-time checks before using any APIs newer than your deployment target to make sure they are available.
You can set the deployment target in the target General settings or the project Info settings.

How to downgrade Xcode to previous version?

I have to use Xcode occasionally, and have now come across a problem where I've upgraded to Xcode 4.6, but another piece of software I'm using doesn't support it, so I need to go back to Xcode 4.5.
I'm not used to the way Macs work in general, so if the answers provided could be written with that in mind, that'd be helpful. :)
I'm assuming you are having at least OSX 10.7, so go ahead into the applications folder (Click on Finder icon > On the Sidebar, you'll find "Applications", click on it ), delete the "Xcode" icon. That will remove Xcode from your system completely. Restart your mac.
Now go to Xcode Releases page or Apple Developer More Downloads and download an older
version of Xcode, as needed and install. You need an Apple ID to login to that portal.
After install, you can also switch between multiple versions:
Xcode > Preferences > Locations > Command Line Tools
When you log in to your developer account, you can find a link at the bottom of the download section for Xcode that says "Looking for an older version of Xcode?". In there you can find download links to older versions of Xcode and other developer tools

XCode 3 -> 4 confusion

I've just upgraded from OSX 10.6 -> 10.8. I had XCode 3.2.6 installed and I installed 4.5 through the appstore. I appear to have both versions installed now (which I don't mind) but I'm lost as to where everything lives now, /Developer doesn't seem to have anything new in it.
Also, my commandline tools like svn have stopped working now, they are not found. I know XCode 4 has newer and better tools (newer SVN, Git, etc) but how do I get it set up nicely? I thought cmd-line tools were part of the XCode 4 installation.
Uninstalling 3.2.6 is fine if needed, I just want to avoid clashes.
To answer your specific questions, Xcode 4.5 is in your Applications folder. It is packaged as a single app instead of using the /Developer folder. Xcode 3.2.6 is in your /Developer folder. You can keep both versions installed.
Xcode 4.5 does not install the command line tools initially. You can install them from Xcode's Downloads preferences. You can also install them by choosing Xcode > Open Developer Tool > More Developer Tools.
I'd look up any transition guides for moving from Xcode 3 to 4. There are lots of different features, so it may take a while to get used to the new layout and where Xcode puts things.
Try these links for starters:
http://docs.xamarin.com/ios/tutorials/transitioning_from_xcode_3_to_xcode_4
http://beginning-mac-programming.timisted.net/xcode-4-general-overview.html

Resources