Xcode OSX SDK is more current than my OS - xcode

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.

Related

XCode 12.0.1 and 12.1 Do not build universal applications

Using XCode 12.0.1 or 12.1 on MacOS 10.15.7 on a MacBook Pro, I cannot get my Mac OS application to compile for the arm64 architecture (i.e. make a Universal application). My project has evolved through many many many XCode versions, so I thought maybe it was corrupted somehow.
So, I created a new non-document-based app project in XCode. I then edited the scheme for Run to build for Release. The default build settings included the arm64 archtecture, and "Build Active Archtecture Only" set to NO for Release. I then set the tool bar scheme setting to buid for "Any Mac", built the project and looked at the build log. It built only for the x86_64 architecture.
Apple's documentaton says it should build for both architectures with these settings. What am I missing?
The problem is Apple's documentation, whoch clearly says XCode 12 builds universal. It does not, as of this writing, you MUST use the xcode 12 BETA.
I've had older Xcode-Projects that just wouldn't build universal binaries. It was due to a VALID_ARCHS user defined variable in one of the build settings (at the very bottom of the list). Once removed, universal binaries were created.

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.

XCode5 says missing SDK 10.7, but I only refer to 10.8

I just installed OS X 10.8 and XCode 5 and I am trying to build a project. I changed the base SDK and Deployment target both to 10.8 and I get this error.
I can't find any reference to 10.7 in my settings, any ideas?
Xcode typically only ships with one SDK for each platform (e.g. Xcode 5 supports iOS 7 & MacOS 10.9 SDK; and at this precise moment it also has MacOS 10.8's SDK built in but probably not for much longer), so in my own settings I typically refer to "Latest SDK" (whichever is shipping with the installed version of Xcode).
And then you can reset "minimum deployment version" in your project settings to be the actual minimum MacOS version (10.5, 10.6, 10.7) you want to run on.
Now, if you do NOT see references to "10.7" in your settings, you may need to actually look at the raw XML of your "project.pbxproj" which resides within your Xcode project. You can look at it in a text editor and see if it's referring to 10.7 anywhere unexpected within it.

How to point Xcode to an old SDK so it can be used as a "Base SDK"?

My Mac's Setup:
Volume A:
OS X 10.8
Xcode 4.5 or later - 10.6 SDK IS NOT available as Base SDK
Volume B:
OS X 10.7
Xcode 4.3.3 - 10.6 SDK IS available as Base SDK
Volume C:
OS X 10.6
Xcode 4.2 - 10.6 SDK IS available as Base SDK
On Volume A, I have installed Xcode 4.5, which does not include the 10.6 SDK as an available "Base SDK" in my Build Targets' Build Settings.
I have a separate 10.6 volume and 10.7 volume on this hard drive - both of which have Xcode installed, and both of which allow me to select the 10.6 SDK as a Base SDK in my Xcode Build Targets' Build Settings.
I know that I have the 10.6 SDK installed on Volume C (at /Developer/SDKs from an older Xcode installation).
How can I point Xcode on Volume A to the 10.6 SDK which lives on Volume C?
You'll need to add a symlink to the old SDK (this is generally easier than copying).
cd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
ln -s /path/to/old/SDK .
This works fine back to 10.5. Beyond that things get a little more complicated...
While there's no promise in future versions of Xcode that this will be supported, I've chatted with the Xcode team about it and they don't seem keen on changing it anytime soon.
Personally I often keep /path/to/old/SDK in a top-level directory called /SDKs. That way every time I upgrade it's easy to fix everything up.
EDIT: I have a fix-xcode script that simplifies re-applying this fix every time Xcode upgrades.
UPDATE: In modern versions of Xcode (7.3+) to use older SDKs edit MinimumSDKVersion here:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist
Wrong approach. You don't "point" Xcode at an SDK. Instead you will have better luck copying the SDK into the appropriate "SDKs" folder for the Xcode installation. In modern Xcode installations this is usually:
Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
Copy the SDK in there, quit and restart Xcode and see what you find.
(reading the other answer here I think that symbolic linking might be an option if you are dead-set on keeping the original SDK elsewhere)
Why not just symbolic link the SDK's? "ln -s"? If that doesn't work there's going to be some plist hacking required.
Solved by browsing to older version Xcode.App/Developer/platforms and copy the iOS 6.1 SDK into same folder of XCode 5.

Resources