Reputation: 7895
Being primarily an iOS developer, I am curious about how to tackle a current OS X project that I am working on. I will be creating an application that will remain running after being launched and will wait upon an action before it triggers its main functionality. In short, I need to be able to trigger this action from the command line.
I'm curious what is the best way to handle the communication between the command line app and the application itself. I will just be passing a few string values from the command line to the running application. I know I can use sockets or control files, but I'm not as experienced with OSX development, and I was curious if these were preferred options of if there was a better approach.
As a side note - this is not an application that will be submitted to the Mac App Store - so I am less concerned about some of the restrictions that come with that.
Upvotes: 0
Views: 180
Reputation: 4282
You can launch the application with arguments by using open
command:
To notify directly, Distributed Notification is generally recommended:
NSDistributedNotificationCenter
. Its no difficult than normal NSNotification.
Upvotes: 1