iosmacosjailbreaklaunch-daemon

What's the different of Program and ProgramArguments


Is there any reference to tell the difference between 'Program' and 'ProgramArguments' in launchdaemon.plist?

I saw some plist only have 'ProgramArguments', but some also have 'Program', I want to make a clear understanding.

Thanks in advance.


Solution

  • It's indeed a bit confusing, but in most cases both forms are valid.

    From the documentation:

    Program < string>
    This key maps to the first argument of execvp(3). If this key is missing, then the first element of the array of strings provided to the ProgramArguments will be used instead. This key is required in the absence of the ProgramArguments key.

    ProgramArguments < array of strings>
    This key maps to the second argument of execvp(3). This key is required in the absence of the Program key. Please note: many people are confused by this key. Please read execvp(3) very carefully!