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?

Nicholas Riley
  • 43,532
  • 6
  • 101
  • 124
Mark Harrison
  • 297,451
  • 125
  • 333
  • 465

4 Answers4

20

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.

kenorb
  • 155,785
  • 88
  • 678
  • 743
Nicholas Riley
  • 43,532
  • 6
  • 101
  • 124
  • 1
    Splendid, thanks! I can't imagine why that's not set be default. – Mark Harrison Aug 12 '09 at 05: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. – Jeffrey Hantin Aug 27 '10 at 22:15
  • FYI what the link was pointing to in this answer has been moved. – James Apr 17 '20 at 16:32
  • No luck on Mac 10.15.7, XQuartz 2.8.1 (xorg-server 1.20.11) – DouglasDD Jun 01 '21 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 '21 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
Lorin Hochstein
  • 57,372
  • 31
  • 105
  • 141
4

For XQuartz,

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

See this link.

T_T
  • 1,202
  • 16
  • 22
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.

kenorb
  • 155,785
  • 88
  • 678
  • 743