After upgrading XQuartz to 2.8.0_beta3 I found that it completely stopped working with Terminal-issued commands. XQuartz would launch ok, but no window would open.
This is how I fixed it (adapting procedure from https://www.l3harrisgeospatial.com/Support/Self-Help-Tools/Help-Articles/Help-Articles-Detail/ArtMID/10220/ArticleID/15775/XQuartzX11-failing-to-launch-automatically-when-running-ENVI-or-IDL which itself did not work):
1) First, you want to unload the XQuartz service. Issue the following command in a terminal:
launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
sudo launchctl unload \ /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist
You may receive errors from the above steps if your XQuartz installation is broken. It’s ok – proceed to the next step.
2) Next, completely remove any trace of XQuartz from your Mac. This is easier said than done, since it places itself throughout your system files.
What I did was to find all folders and files with XQuartz in the name:
cd /
sudo find . -iname "*xquartz*"
3) Now remove the folders/files with xquartz in their name from step 2.
DISCLAIMER: deleting system files could break your operating system and/or result in data loss if you make a mistake. Do not proceed unless you know what you are doing and your machine is fully backed up. I do not take any responsibility for damages or data loss.
sudo rm -rf file1
sudo rm -rf file2
...
4) In addition, delete the X11 folder:
sudo rm -rf /opt/X11
5) Issue sudo pkgutil --forget org.macosforge.xquartz.pkg
6) Log out and log back in again.
7) Finally, download and install the latest release version (not beta) of XQuartz from xquartz.org (2.7.11 at the time of writing). Follow the instructions to log out and log back in, and you should have a working XQuartz again.