Skip to content

Latest commit

 

History

History
66 lines (44 loc) · 1.28 KB

README.md

File metadata and controls

66 lines (44 loc) · 1.28 KB

Creating and installing .pkg packages on macOS

Mockup project containing experiments with packaging and installing custom jobs or deamons on macOS. Tasks are performed with standard macOS tools: pkgbuild and installer.

Usage

Build and install a mockup job which runs every minute and prints a timestamp in a log file.

make build
make install

Build a script-only (no payload) package which can be used to unload the LaunchDaemon and uninstall the job script and corresponding files (logs ecc.)

make build-uninstal
make uninstall

Compatibility

These tools are expeted to work fine on macOS 11.x.

Usefull commands

Load/unload LaunchDaemon job

Bootstraps a service or directory of services and respectively unloads a service or directory of services.

launchctl load /Library/LaunchDaemons/d76.mockup-job.plist
launchctl unload /Library/LaunchDaemons/d76.mockup-job.plist

Forget an installed package

Discard receipt data for the specified package.

pkgutil --forget d76.mockup-job

Force the execution of job/deamon

sudo launchctl kickstart system/d76.mockup-job

Resources

Manual pages

  • man pkgbuild
  • man installer
  • man pkgutil
  • man launchctl

Links