Skip to content

Simple example of a mac app launch agent. People can use as a template. Starts and Stops via different bash scripts.

License

Notifications You must be signed in to change notification settings

md-command-line/mac_plist_launch_agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TLDR; to incorporate your main executable:

  1. overide app/script.sh with terminal install instructions.
  2. This repository can be found at https://github.com/MichaelDimmitt/mac_plist_launch_agent/

Installation(program persists when installed until uninstalled.)

  1. git clone your_project.git

  2. cd your_project

  3. git clone https://github.com/MichaelDimmitt/mac_plist_launch_agent.git

  4. cd mac_plist_launch_agent

  5. ./app/install_driver.sh

  6. ./app/uninstall_driver.sh

  7. now, modify script file to run your application from current DIR/../ to access your app.

Template from which others can build Launch Agents.

Only for Macintosh Computers, enjoy. Make an application or a script a launch agent.

Simple example of a mac app launch agent. People can use as a template.
Starts and Stops via different bash scripts.

Challenges (why needed)

Launch Agents do not immediately provide output
to where a programmer can immediately see hello world.
install_driver... sets the plist up and runs.

install and start

  1. ./mac_plist_launch_agent/app/install_driver.sh

uninstall and stop

  1. ./mac_plist_launch_agent/app/uninstall_driver.sh

to incorporate your main executable:

  1. overide app/script.sh with terminal install instructions.

how install_driver sets the plist up and runs:

app/install_driver allows plist to know your repo location
app/install_driver script gathers "pwd" and injects it into the plist
then install driver gives permission moves to standard location and runs.
uses launchctl...

Useful links

https://nathangrigg.com/2012/07/schedule-jobs-using-launchd
https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man5/launchd.plist.5.html

Large scale implementation:

project abstracted from:
https://github.com/MichaelDimmitt/Aerial_Desktop

About

Simple example of a mac app launch agent. People can use as a template. Starts and Stops via different bash scripts.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages