以sshd服务为例

启动sshd服务:
sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist

停止sshd服务:
sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist

查看是否启动:
sudo launchctl list | grep ssh

成功启动:
--------------
- 0 com.openssh.sshd