19

So I moved some X programs down to the mac, and I'm getting

Error: XTEST extension unavailable on '(null)'.

from xdotool.

  • Does OS X X11 come with XTEST?

  • If not, is there a way to add it?

4 Answers 4

21

Run the following command in the Terminal:

defaults write org.x.X11 enable_test_extensions -boolean true

(as per here). Then quit and restart the X server; the XTEST extension should then be available.

5
  • 1
    Splendid, thanks! I can't imagine why that's not set be default. Aug 12, 2009 at 5:21
  • 4
    Automating input may be seen as a security risk, especially since XTEST doesn't set the send_event flag in the XEvent structure which lets the application know it's being automated. Aug 27, 2010 at 22:15
  • FYI what the link was pointing to in this answer has been moved.
    – James
    Apr 17, 2020 at 16:32
  • No luck on Mac 10.15.7, XQuartz 2.8.1 (xorg-server 1.20.11)
    – DouglasDD
    Jun 1, 2021 at 10:13
  • 2
    I'm on macOS 11.4, and this does not seem to do anything. Running xdpyinfo I can see that XTEST is not listed under the 'number of extensions' section. ...
    – postylem
    Jun 14, 2021 at 17:55
8

I had to do the following two commands to get this to work on Mountain Lion (from here):

defaults write org.x.X11 enable_test_extensions -boolean true
defaults write org.macosforge.xquartz.X11 enable_test_extensions -boolean true
2
  • 3
    Neither one helped on Mac 10.15.7, XQuartz 2.8.1 (xorg-server 1.20.11)
    – DouglasDD
    Jun 1, 2021 at 10:14
  • defaults write org.xquartz.X11 enable_test_extensions -bool yes seemed to work for me.
    – rjmunro
    Jul 4, 2021 at 18:22
4

For XQuartz,

defaults write org.macosforge.xquartz.X11 enable_test_extensions -bool yes

See this link.

2

Mac has test extension as part of the open source XQuartz project (if installed).

The X11.app was available by default for Mac OS X v10.5-10.7, but since Mountain Lion, Apple dropped dedicated support for X11.app, with users directed to the open source XQuartz project (to which it contributes) instead.

To test if the TEST extension is enabled, try the following commands:

$ defaults read org.x.X11
{
    "enable_test_extensions" = 1;
}
$ defaults read org.macosforge.xquartz.X11
{
...
    "enable_test_extensions" = 1;
    "startx_script" = "/opt/X11/bin/startx -- /opt/X11/bin/Xquartz";
}

For downloading instructions, check XQuartz page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.