Can't launch application as root: secinitd > registration request failed I just tried to launch an application as root with

sudo /Applications/Calculator.app/Contents/MacOS/Calculator

but it doesn't work anymore. It used to work because I had scripted my own workflow in Yosemite, and now in El Capitan it stopped working somewhere along the update line (currently on 10.11.6). In the Console I get the following:


26/08/16 13:44:04,508 sudo[3205]:    USER : TTY=ttys000 ; PWD=/Users/USER ; USER=root ; COMMAND=/Applications/Calculator.app/Contents/MacOS/Calculator


26/08/16 13:44:04,521 secinitd[352]: com.apple.secinitd.connection-from.3207: registration request failed: (0x13, 0xd) Incoming message euid does not match xpcd uid (0 != 501).


I tried to do it with the 3rd-party XtraFinder "Launch as Root" function, but that doesn't work either.

SIP is completely disabled; root user is enabled; trying this in my admin space (501).

Does anyone else have the same problem? What could be the reason? Thanks for your help.
Found a solution myself:

sudo /bin/launchctl asuser 0 /Applications/Calculator.app/Contents/MacOS/Calculator

Console:

26/08/16 15:12:25,946 sudo[34364]:    USER : TTY=ttys000 ; PWD=/Users/USER ; USER=root ; COMMAND=/bin/launchctl asuser 0 /Applications/Calculator.app/Contents/MacOS/Calculator

26/08/16 15:12:27,891 secinitd[34367]: UID[0]: cache loaded: /System/Library/Caches/com.apple.app-sandbox-cache.plist

This will ensure that the request actually comes from 0, not from 501. It might not be the only possible solution, but it worked here. If you know any alternate methods, let us know. Thank you.