此 API 的大部分内容现已弃用(macOS 10.14 SDK):
/*!
* @header
* These interfaces were only ever documented for the purpose of allowing a
* launchd job to obtain file descriptors associated with the sockets it
* advertised in its launchd.plist(5). That functionality is now available in a
* much more straightforward fashion through the {@link launch_activate_socket}
* API.
*
* There are currently no replacements for other uses of the {@link launch_msg}
* API, including submitting, removing, starting, stopping and listing jobs.
*/
该解决方案似乎使用launchctl
(man launchctl
或此处的在线内容:https ://ss64.com/osx/launchctl.html )。可能是这样launchctl list | grep <agent label>
的。