Run an application as another user in Mac 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 /Applications/Sketch.app/Contents/MacOS/Sketch
Also I have tried:
su otheruser -c &quot;/Applications/Sketch.app/Contents/MacOS/Sketch&quot;

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.
You can‘t run UI applications as user A while being logged in as user B. The easiest way to get something similar is to enable Fast User Switching and then switch between user A and user B as needed. But each user will have its own Finder etc then, you can‘t use applications on the same screen at once.