In the last post, I was finally back up and running with my IDE after an update to Serenata. Or maybe not...
After updating iPhone iOS version to 14.6+, Xcode 12.4 can no longer build to that iPhone device. In Xcode when choosing a Build Destination (Product Destination device or from the UI dropdown shown below) the newly updated iPhone will have beside it (unsupported OS version): iPhone listed with '(unsupported OS version)'.
Turns out, another update broke something. MacOS Catalina was released recently and introduced a new version of PHP (7.3.8 in my case). This change means XDebug is now referencing outdated Zend API, which throws an error when running pretty much anything. Oops, beause no XDebug egals no PHPUnit code coverage report.
On MacOS Mojave, getting XDebug was a matter of installing Pear, setting up some Xcode SDK Headers file, installing XDebug from source using Pear and enabling XDebug in PHP configuration files. Sounds easy, should be the same for Catalina...
- Therefore, XCode is an integrated development tool for macOS operating system. Containing this great tool was developed by Mac or Apple company to build software, programs, Apps and many more. This tool can be used for developing macOS, iOS, watchOS, and tvOS. The first release of XCode was in 2003 at that time the latest version of XCode 10.2.
- With the Catalina upgrade, my Xcode did not automatically update to 11.1. The App Store kept trying to update Xcode each night through automatic updates. On its own, it never succeeded. Once it reported it could not download Xcode: Unable to Download App. 'Xcode' could not be installed. Please try again later.
- Version Release Build Released Requires macOS SDKs iOS SDKs watchOS SDKs. Xcode Tools 1.2: Release: 7K249: 22 Apr 2004: macOS 10.3+ Xcode Tools 1.1: Release: 7K224.
Spoiler alert, Xcode 11 comes with a massive breaking change.
Installing XDebug
Assuming Pear, Autoconf, and Xcode is installed on your computer, installing XDebug should be easy as :
But now, I'm getting the following error. This is because the compiler requires some header files, which are provided by the MacOS SDK bundled with Xcode. Not a surprise, as it was the same error with previous version of MacOS, aka Mojave :
The Mojave Solution
On Mojave, the following step was necessary to install the missing header files. Don't actually run this command on Catalina, as it will fail.
The problem is the SDK headers package was removed starting with Xcode 11.0. And we can't just change 10.14
to 10.15
to make it work...
The Catalina Issue
After a lot of digging, I've found the actual files are actually stored somewhere :
And if you look closely,
See the error returned by phpize
claiming /usr/include/php/main/php.h
doesn't exist? Turns out, /usr/include
doesn't actually exist on my system:
If you try to symlink one into the other, even using sudo, that won't work, thanks to SIP :
The reason is Apple has deprecated having a /usr/include
distinct from the SDK. This has been completely removed in Catalina so different SDK and Xcode version could be run together.
So now the issue is, in order to compile XDebug, we need to either tell the compiler to use the headers from a different location, or actually put the required files in /usr/include
...
Until this issue is resolved, either on Apple side or XDebug side, not much can be done other than use a VM to run tests locally...
Xcode Version For Catalina Download
References for later
Mac users with macOS Mojave and macOS Catalina, and new operating systems in place can now install Command Line Tools from the Xcode IDE without needing to install the entire Xcode package, or opening an Apple developers account.
Did you know: Using Xcode app leaves behind a lot of junk files a.k.a. 'development junk.' These files are usually hidden from view but you can delete them with a Mac maintenance app CleanMyMac X.
Xcode Version For Catalina
In this article, we cover how you can install this optional and highly useful Command Line Tools package.
X code 11. Credit: developerinsider
What is the Xcode Command Line Tools package?
For Mac power users — we wouldn't recommend downloading this unless you are comfortable with Terminal — the Xcode Command Line Tools package gives you a complete Unix toolkit accessible through Terminal. No developer account needed and you don't need to download the entire — and quite large Xcode package of executables.
Within the Xcode Command Line toolkit, Mac users gain access to numerous useful tools, utilities, and compilers, including make, GCC, clang, perl, svn, git, size, strip, strings, libtool, cpp, and many others. All of these commands are a default part of Linux systems and programs.
We recommend following these steps for those with the following operating systems running on a Mac: macOS 10.13 High Sierra, macOS 10.14 Mojave, and macOS 10.15 Catalia onward. It isn't always possible to download these Xcode Command Line Tools, following these steps, on Mac’s running older operating systems. Other ways to install command tools and gcc (without needing Xcode) is available through the Apple Developer website.
Here is how you install Xcode Command Line Tools.
How to install Xcode Command Line Tools?
- Go to Terminal in /Applications/Utilities/.
- Input the following command string in Terminal:
xcode-select —install
- In the same way when you are downloading new software and apps, a popup update window will appear asking you: “The xcode-select command requires the command line developer tools. Would you like to install the tools now?”
- Select confirm by clicking Install.
- Wait for the Xcode Command Line Tools package to install. It is around 130 MB and usually installs fairly quickly; although it depends on your connection.
- Once everything is installed, the installer goes away and you should be able to any of the new commands that you’ve now got access to. Enjoy using your new Unix command line tools!
Alternative way to install command line tools
If the Terminal combination didn't work, open the Finder > Go to Folder...menu.
Paste in the following path:/System/Library/CoreServices
In that location, find the app called Install Command Line Developer Tools.app — it will have a blue globe icon.
Click this app and then try the Terminal method explained above.
With this new download, you should have access to 61 Unix command line tools. For example, one of the advantages of having these tools is you can install new apps and software directly from the source code instead of needing to go through the package manager and usual download route.
To access or view everything you've now got, go to the following directory:
/Library/Developer/CommandLineTools/
Xcode Version For Catalina 2020
Please note, this is the root /Library of your macOS/OS X, not the ~/Library directory.
All of these tools can also be found in: /Library/Developer/CommandLineTools/usr/bin/
These tools like small executable apps (which they are):
What happens if I encounter problems downloading these?
If you get an error message that says “Can’t install the software because it is not currently available from the Software Update server”, it means you've already got the Xcode package on your Mac. Mac OS X 10.9 onward, Xcode was already installed, which is why you aren't able to download these tools. However, what you can do is uninstall the entire Xcode app if you'd prefer to only access these tools and not a whole load of software that isn’t going to be of much use.
Watch out for Xcode junk
The Xcode junk is one of those types of clutter that is keeps accumulating in remote places on your Mac. It could take up a few gigs of your space. The only app that seems to address this problem is CleanMyMac X by MacPaw. It’s loved by many Mac developers because it collects those specific types of development junk, like Xcode or outdated libraries.
Once you launch the app, click on System Junk > Scan. Then, click “Review Details”
CleanMyMac X is a powerful Mac performance improvement app. It makes your Mac as good as new. Let it scan your system and clear out any unwanted Xcode, development and system junk that is taking up too much space and cluttering up your Mac. In a few clicks, your Mac could be running smoother, quicker and more efficiently.