I have tried various methods mentioned across many sites, but cant able to run perfectly on newer versions of mac os. I have tried:
sudo -i -u otheruser -H OR sudo login -f otheruser
And try running the app in the new prompt using
Also I have tried:
su otheruser -c "/Applications/Sketch.app/Contents/MacOS/Sketch"
All of these run the app. But as soon as I open something which require system events (such as requesting macos native file picker) the application crashes. The following error is visible when such events are started.
+[NSXPCSharedListener endpointForReply:withListenerName:]: an error occurred while attempting to obtain endpoint for listener 'com.apple.view-bridge': Connection interrupted
I have tried with many applications. Exactly same error occurs. Please help.