QGIS 4 on macOS 27.2

The problem. After updating a Mac to macOS 27.2, QGIS 4.2 closes a few seconds after you start it, before the window appears, or macOS reports that it quit unexpectedly. This is a known fault (QGIS issue 67981). It is not caused by your projects or settings, and reinstalling QGIS does not help.

The cause. Some of the small images QGIS uses (its Dock icon and some mouse cursors) contain a colour profile. Since 27.2, macOS fails on the way the version of Qt inside QGIS passes that profile on, and QGIS crashes. The real fix has to come from Qt and QGIS. Until then, the workaround below removes the colour profiles from a copy of QGIS.

The workaround (about five minutes)

The script makes a copy of QGIS in the folder Applications in your home folder, patches the copy, and signs it for your Mac. The QGIS in /Applications is not changed.

  1. Close QGIS if it is open.

  2. Open Terminal (Finder › Applications › Utilities › Terminal).

  3. Paste these two lines and press Return:

    curl -fsSL https://semanticgis.org/Data/assets/scripts/qgis-macos27-patch.sh -o ~/Downloads/qgis-macos27-patch.sh
    sh ~/Downloads/qgis-macos27-patch.sh
    
  4. Wait. Copying takes a few minutes and signing a minute or two. The script prints Cursor images patched: 6, then Done. Start QGIS from …, and opens QGIS.

  5. From now on start QGIS from the copy: open Finder, press ⇧⌘H (your home folder), open Applications and double-click QGIS-4.2.x-patched. Drag it to the Dock to keep it there. The old QGIS in the Dock will still crash.

You can read the script before running it. It uses only tools that come with macOS.

If something goes wrong

  • No QGIS 4 found in /Applications: give the path of your QGIS, e.g. sh ~/Downloads/qgis-macos27-patch.sh /Applications/QGIS-final-4_2_3.app.
  • … exists already: you have run it before. Drag QGIS-4.2.x-patched from your home folder’s Applications to the Trash and run the script again.
  • “Operation not permitted”: macOS protects an app from changes once it has been opened. Never open the copy before the script has finished; if you did, put it in the Trash and run the script again.
  • “QGIS … is damaged and can’t be opened”: the signing step did not finish. Put the copy in the Trash and run the script again, and bring the text Terminal printed to class if it fails again.
  • QGIS still crashes: bring the crash report (the text in the “quit unexpectedly” window, Report…) to class.

Notes

  • After updating QGIS the new version is unpatched. Check first whether it starts by itself (the fault may be fixed); if not, run the script again.
  • Disk space: the copy takes about 3.6 GB. Once a fixed QGIS is out, put the copy in the Trash.
  • Signed for your Mac only: the copy carries a local signature, not the QGIS project’s, so it runs on your Mac but should not be passed on to others. Everyone runs the script on their own Mac.
  • QGIS 3.44 LTR does not have this fault and can be used meanwhile. It may report a crash when you quit it; that happens after it has closed your project.