0
votes

I'm trying to configure a launchd agent which should run on demand when my app wants to communicate with it.

Tried few approaches like using WatchPaths or a socket port but the problem arises when there are few users logged in to the system (via fast user switching).

If I monitor a path or port and User A opens my app, the agent sometimes starts through the User's B session and vice-versa, because they both monitor them.

When I'm logged in as User A, I want the Launch Agent run as this user.

My plist is stored in /Library/LaunchAgents. Any ideas?

1

1 Answers

0
votes

Place your launch agent in ~/Library/LaunchAgents and create WatchPaths in user space(~/Library/Application\ Support/yourApp/watch)