Skip to main content

Mac Onboarding with Alectrona Patch

Mac Onboarding with Alectrona Patch lets administrators define a set of applications that should be installed during a device's first-run experience. It is designed for MDM enrollment workflows where a new Mac needs a curated baseline of software the moment the user logs in — and it is idempotent, so repeated triggers are no-ops once each app's install has succeeded.

Mac Onboarding is configured via the Onboarding key in the com.alectrona.patch-agent MDM domain. The agent invokes the onboarding flow automatically at startup and on configuration changes, and the same flow can be triggered manually with the patch onboard install command line tool.

Mac Onboarding is once-and-done

Each app's successful install is recorded in a persistent store. Subsequent invocations skip already-completed apps regardless of how the flow is triggered. This means you can safely re-invoke Mac Onboarding (via MDM redeploy, a script, or patch onboard install) without re-installing apps that have already landed.

Supported Inner Keys​

KeyTypeDefaultPurpose
CatalogIDsArray of strings(required)The catalog IDs of apps to install during onboarding.
PreserveOrderBooltrueInstall apps strictly in the order declared in CatalogIDs. Downloads remain concurrent — only the install step is sequenced.
HaltOnErrorBoolfalseStop the onboarding run as soon as an app's install fails. Useful when later apps depend on earlier ones.
SkipIfInstalledBooltrueTreat apps that are already installed as complete without updating them. Set to false to allow Mac Onboarding to perform an install-or-update pass on every listed app.
MaxDeviceAgeSecondsInteger(unset)Optional safety gate. When set, the Patch Agent skips Mac Onboarding on devices whose age exceeds this threshold. Useful when an MDM profile is deployed fleet-wide and the admin wants to prevent Onboarding from running on existing devices. Only gates the agent-driven path; patch onboard install from the CLI is unaffected.

Common Use Cases​

"Every new Mac in our fleet should have Google Chrome, Slack, and 1Password installed on first run."

The simplest Mac Onboarding configuration is just a list of CatalogIDs. The agent installs each app once during the device's initial enrollment; subsequent triggers are no-ops.

<!-- Domain: com.alectrona.patch-agent -->

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Onboarding</key>
<dict>
<key>CatalogIDs</key>
<array>
<string>google-chrome</string>
<string>slack</string>
<string>1password</string>
</array>
</dict>
</dict>
</plist>

Triggering Mac Onboarding from the Command Line​

The patch onboard subcommand provides three commands for working with Mac Onboarding from the CLI. These are useful for testing, for Self Service workflows, and for manual reset during development.

patch onboard install​

Triggers the onboarding flow with one or more catalog IDs. The same idempotency rules apply — already-completed apps are skipped — so this command can be invoked safely from postflight scripts, Self Service buttons, or test runs.

# Install three apps as part of device onboarding, preserving install order
# (already-completed apps are skipped on subsequent invocations; --preserve-order
# is the default for `onboard install`, shown here for clarity)
sudo patch onboard install microsoft-company-portal google-chrome slack --preserve-order
note

patch onboard install requires at least one app ID as a positional argument. The CLI does not read the configured Onboarding.CatalogIDs preference — that is the agent's path. CLI-driven runs are independent.

patch onboard list​

Lists the catalog IDs that have already completed onboarding on this device, so administrators can verify what is recorded in the persistent store.

sudo patch onboard list

patch onboard reset​

Clears the onboarding completion store. The next invocation of patch onboard install (or the next agent-driven onboarding event) will attempt every configured app again, regardless of whether it was previously marked complete. Useful during testing or after rebuilding a device's baseline.

sudo patch onboard reset

Visibility​

Mac Onboarding progress is recorded in the Patch log at /var/log/alectrona-patch.log. The log captures which app IDs were targeted, the order in which installs were attempted, and which IDs reached success (and were therefore marked complete in the persistent store).

The completion store itself is inspectable via patch onboard list, which is the recommended way to verify what has and has not yet onboarded on a given device.

See Also​