Post

Replies

Boosts

Views

Activity

How to launch a User Agent on Demand
I am developing a screen share app and would like to launch an agent on demand whenever i receive a request to the port on which the app listens. Based on the documentation available from Daemons & Agents , i designed a plist file which looks like this, <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.myapp.assist-loginserver</string> <key>LimitLoadToSessionType</key> <array> <string>LoginWindow</string> <string>Aqua</string> </array> <key>ProcessType</key> <string>Interactive</string> <key>ProgramArguments</key> <array> <string>/Applications/My\ App\ share.app/Contents/MacOS/My\ App\ Assist</string> <string>--args</string> <string>--launcher</string> </array> <key>Sockets</key> <dict> <key>Listeners</key> <dict> <key>SockServiceName</key> <string>50053</string> </dict> </dict> </dict> </plist> However when i pass a request to the listening port '50053' , i don't see the app being launched. From the terminal , if i provide the Program Arguments separated by space , i can see app launch . So i don't think there is a problem with Program Arguments. When i look for active ports , i can see the port '50053' being monitored by launchd. sh-3.2# lsof -i:50053 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME launchd 1 root 30u IPv6 0xb9009595656d4fe7 0t0 TCP *:50053 (LISTEN) launchd 1 root 43u IPv4 0xb900959efe5cf82f 0t0 TCP *:50053 (LISTEN) when i pass in a curl request to the port , i do see a TCP Establishment , but it doesn't launch the app. I would like the app to be launched and let the app handle the socket connection (50053) till it is alive sh-3.2# lsof -i:50053 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME launchd 1 root 30u IPv6 0xb9009595656d4fe7 0t0 TCP *:50053 (LISTEN) launchd 1 root 43u IPv4 0xb900959efe5cf82f 0t0 TCP *:50053 (LISTEN) curl 15759 testuser 5u IPv4 0xb900959efe5ca2ff 0t0 TCP localhost:50054->localhost:50053 (ESTABLISHED) Any help on this will be much appreciated Thanks, Abhilash
10
0
1.4k
Mar ’23
How to identify users connected to Macbook via screen share app
I need to know the list of all users connected live to the system. I am able to fetch the users detail using ioreg -d1 -c IORegistryEntry -a and look for IOConsoleUsers . But this doesn't provide information regarding the users connected via native screen share app of Mac. How can we get this detail via command line or using some files ? Thanks in Advance, Abhilash Vaidhya
1
0
854
Mar ’23
Interacting with Login Window using third party screen share app
I'm currently developing a screen-sharing app and i followed this post to setup daemons & agents , and i am able to screen share succesfully. In user-context , keyboard and mouse movements work fine; But during the login screen (first login or all users logged out) , i can perfectly relay the screen , but the app is not able to interact with the login window . ie Mouse clicks/keyboard actions fail in the login window. Is there a special configuration i'm missing to ensure the system trusts third party app for getting user inputs when logged out ? Request your help on this Attach LaunchAgents plist LaunchAgents
4
0
812
Mar ’23