Deploy Ploy Desktop with your MDM on Mac
Ploy Desktop is Ploy's menu bar app for Mac. You can deploy it with any MDM that can push a configuration profile and run a script as root. Employees then sign in once, and never have to type your company's details.
Guides for specific MDMs: Ploy Desktop via JumpCloud on Mac, Ploy Desktop via Kandji (Iru) on Mac, Ploy Desktop via Jamf Pro on Mac.
Before you begin: you'll need admin access to your MDM console and your Ploy subdomain.
What you need
Macs on macOS 14.4 or later
Admin access to your MDM
Your Ploy subdomain: the first part of your employee portal address, e.g.
acmefromacme.employee-access.comPloy Desktop switched on in your Ploy dashboard under Settings → Apps. It's on unless someone has turned it off.
How it fits together
A configuration profile tells Ploy Desktop which company it belongs to. It also marks the Mac as managed, so the app leaves installing and updating to you, and never asks employees for an administrator's password.
A script installs Ploy Desktop. Each time it runs after that, it installs the new version if there is one. Run it daily.
Device inventory, if you want it, is switched on in your Ploy dashboard.
Push the profile before the app. If a Mac gets the app first, Ploy asks for your company's subdomain until the profile arrives.
Step 1 – Create the configuration profile
Save this as ploy-desktop.mobileconfig. Then:
Replace
acmewith your Ploy subdomain.Replace each of the three
REPLACE-WITH-A-FRESH-UUIDvalues with a different UUID. Runninguuidgenin Terminal prints one.
The profile also allows Ploy's notifications, so employees aren't asked for permission.
<?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>PayloadContent</key>
<array>
<dict>
<key>PayloadType</key>
<string>com.joinploy.desktop</string>
<key>PayloadIdentifier</key>
<string>com.joinploy.desktop.settings</string>
<key>PayloadUUID</key>
<string>REPLACE-WITH-A-FRESH-UUID</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>PayloadDisplayName</key>
<string>Ploy Desktop settings</string>
<key>subdomain</key>
<string>acme</string>
</dict>
<dict>
<key>PayloadType</key>
<string>com.apple.notificationsettings</string>
<key>PayloadIdentifier</key>
<string>com.joinploy.desktop.notifications</string>
<key>PayloadUUID</key>
<string>REPLACE-WITH-A-FRESH-UUID</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>PayloadDisplayName</key>
<string>Ploy Desktop notifications</string>
<key>NotificationSettings</key>
<array>
<dict>
<key>BundleIdentifier</key>
<string>com.joinploy.desktop</string>
<key>NotificationsEnabled</key>
<true/>
<key>AlertType</key>
<integer>1</integer>
<key>ShowInNotificationCenter</key>
<true/>
<key>ShowInLockScreen</key>
<true/>
<key>BadgesEnabled</key>
<true/>
<key>SoundsEnabled</key>
<true/>
</dict>
</array>
</dict>
</array>
<key>PayloadDisplayName</key>
<string>Ploy Desktop</string>
<key>PayloadIdentifier</key>
<string>com.joinploy.desktop.profile</string>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>REPLACE-WITH-A-FRESH-UUID</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>PayloadScope</key>
<string>System</string>
</dict>
</plist>If your employee portal uses your own domain, such as access.acme.com, add it below subdomain:
<key>customDomain</key>
<string>access.acme.com</string>Upload the profile to your MDM and assign it to a test group first.
Step 2 – Install and update Ploy Desktop with the script
The script below installs Ploy Desktop on a Mac that doesn't have it, and updates it when a newer version is out. Otherwise it does nothing. Run it as root, once a day. Paste it into your MDM exactly as it is. It needs nothing else.
Before it installs anything, it checks that:
the download is signed by Ploy (the script carries Ploy's public signing keys)
it contains Ploy Desktop and nothing else
it is newer than the version already installed
If any check fails, it installs nothing.
It exits with 0 when it installed Ploy or Ploy was already up to date. For anything else it exits with 1, and the last line starts with error: and says why.
The package installs to /Applications/Ploy.app and opens Ploy at every login. An update closes Ploy and reopens it for whoever had it open.
#!/bin/bash
#
# Ploy Desktop: install the latest release on this Mac when it is newer than
# the one installed. For any MDM that runs a script as root: a JumpCloud
# command, a Jamf policy script, a Kandji custom script, an Intune shell
# script. See docs/MDM.md, "Updating Ploy with your MDM".
#
# It installs Ploy_<version>.pkg only when all of these hold, and otherwise
# exits 1 without installing anything:
#
# 1. The pkg's detached signature, Ploy_<version>.pkg.sig, verifies with one
# of INSTALLER_KEYS below, Ploy's Developer ID Installer keys. Nothing else
# about the download is trusted: desktop/mac/latest.json only says what
# to fetch.
# 2. The pkg is Ploy's: it holds one package, com.joinploy.desktop.
# 3. That package's own version is the one latest.json named, and strictly
# newer than the receipt macOS keeps for the installed copy
# (`pkgutil --pkg-info com.joinploy.desktop`, which only root can write).
# With no receipt, Ploy was never installed by pkg, and it installs.
# Only the receipt: the app's own version can only move without one by
# tampering, and trusting it would let a user block updates. A Mac that
# Ploy 0.3.2's in-app updater moved past its receipt gets one redundant
# reinstall.
#
# The package itself stops any running Ploy and reopens it for whoever had it
# open. Downloads go to a directory only root can read, removed at the end.
#
# Exit status: 0 installed, or already up to date; 1 anything else, with
# `error: <why>` as the last line.
set -Eeuo pipefail
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
umask 077
BASE="https://ploy-chrome-extension.s3.eu-west-2.amazonaws.com/desktop"
IDENTIFIER="com.joinploy.desktop"
# Ploy's Developer ID Installer public keys, one PEM block each. The same keys
# as apps/desktop/signing/installer-keys/ in Ploy's repository, which a test
# holds this to. A new key comes here, and to every MDM running this, before
# it signs a release.
INSTALLER_KEYS='
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlVeliFBPb/42FXahVDJA
yvw8v/yEup+zEckyptnhMGLjfStFhkFerPDhwWPIC+deZmtBcCUqpPHrG56UrkC+
9xGk01Dh0RzFBojyax4/6p+jQVmB2BrZq5sAm02QjWYi+LuiSTVRGLihGIQPyUQO
IZrWqis3rjkGpCLdrApbs/t2s1b67ty5tIFq9VfCZGvFzNCkW0cw41kKsU95ZjsY
EZViZsOYZqdN4PS7Ia6v4s+1ZJoSFokiwibXfD+TARkRSsxeXMx6H8fb5P4fENeA
ZrCo30QP5yax4mLv9mDgFiiTZsQRenyllP/sr2ZM7cmIdptFPVV56Y90GY6rci9+
ZwIDAQAB
-----END PUBLIC KEY-----
'
fail() {
echo "error: $*" >&2
exit 1
}
# Anything that fails without saying why says what failed, and exits 1.
trap 'echo "error: \"$BASH_COMMAND\" failed (exit $?, line $LINENO)" >&2; exit 1' ERR
[ "$(id -u)" -eq 0 ] || fail "run this as root"
tmp="$(mktemp -d /tmp/ploy-update.XXXXXXXX)"
trap 'rm -rf "$tmp"' EXIT
[ "$(stat -f '%Su %Lp' "$tmp")" = "root 700" ] || fail "$tmp is not root's alone"
fetch() {
curl --fail --silent --show-error --location --proto '=https' --max-time 900 -o "$2" "$1" ||
fail "could not download $1"
}
is_version() { [[ "$1" =~ ^[0-9]{1,5}\.[0-9]{1,5}\.[0-9]{1,5}$ ]]; }
# Whether version $1 is strictly newer than version $2, both X.Y.Z.
newer() {
local a1 a2 a3 b1 b2 b3
IFS=. read -r a1 a2 a3 <<< "$1"
IFS=. read -r b1 b2 b3 <<< "$2"
(( 10#$a1 != 10#$b1 )) && { (( 10#$a1 > 10#$b1 )); return; }
(( 10#$a2 != 10#$b2 )) && { (( 10#$a2 > 10#$b2 )); return; }
(( 10#$a3 > 10#$b3 ))
}
# The feed every build since 0.3.2 reads. (desktop/latest.json is frozen at
# 0.3.2 for the copies before it, and never moves.)
fetch "$BASE/mac/latest.json" "$tmp/latest.json"
# Lookups that may find nothing succeed inside, so the trap stays for real failures.
latest="$(plutil -extract version raw -o - "$tmp/latest.json" 2>/dev/null || true)"
is_version "$latest" || fail "latest.json names '$latest', not a version"
installed="$({ pkgutil --pkg-info "$IDENTIFIER" 2>/dev/null || true; } | sed -n 's/^version: //p')"
if [ -n "$installed" ]; then
is_version "$installed" || fail "the receipt for $IDENTIFIER says '$installed', not a version"
fi
echo "installed: ${installed:-none}, latest: $latest"
if [ -n "$installed" ] && ! newer "$latest" "$installed"; then
echo "up to date"
exit 0
fi
pkg="$tmp/Ploy_$latest.pkg"
fetch "$BASE/Ploy_$latest.pkg" "$pkg"
fetch "$BASE/Ploy_$latest.pkg.sig" "$pkg.sig"
# 1. Signed by one of Ploy's keys, before anything reads the pkg.
printf '%s\n' "$INSTALLER_KEYS" |
awk -v dir="$tmp" '/^-----BEGIN PUBLIC KEY-----$/ { n++ } n { print > (dir "/key-" n ".pem") }'
verified=""
for key in "$tmp"/key-*.pem; do
if [ -f "$key" ] && openssl dgst -sha256 -verify "$key" -signature "$pkg.sig" "$pkg" >/dev/null 2>&1; then
verified=1
break
fi
done
[ -n "$verified" ] || fail "Ploy_$latest.pkg.sig does not verify with any of Ploy's keys; not installing"
# 2 and 3. Ploy's one package, at the version named, newer than what is here.
pkgutil --expand "$pkg" "$tmp/expanded" >/dev/null
set -- "$tmp"/expanded/*.pkg/PackageInfo
[ "$#" -eq 1 ] && [ -f "$1" ] || fail "Ploy_$latest.pkg does not hold exactly one package"
identifier="$(xmllint --xpath 'string(/pkg-info/@identifier)' "$1")"
version="$(xmllint --xpath 'string(/pkg-info/@version)' "$1")"
[ "$identifier" = "$IDENTIFIER" ] || fail "Ploy_$latest.pkg holds '$identifier', not $IDENTIFIER"
[ "$version" = "$latest" ] || fail "Ploy_$latest.pkg holds version '$version', not $latest"
if [ -n "$installed" ] && ! newer "$version" "$installed"; then
fail "Ploy_$latest.pkg is $version, not newer than $installed"
fi
installer -pkg "$pkg" -target /
echo "updated to $version"If Ploy's signing key ever changes, we'll send you a new script first. No release will use the new key until you've had it. An old script refuses a release signed with a new key and installs nothing.
Prefer to push the package yourself? Each version is at https://ploy-chrome-extension.s3.eu-west-2.amazonaws.com/desktop/Ploy_<version>.pkg, and the newest version number is in https://ploy-chrome-extension.s3.eu-west-2.amazonaws.com/desktop/mac/latest.json. The package is signed with Ploy's Developer ID and notarised by Apple, so it installs with no Gatekeeper prompt. If you go this way, you'll need to push each new version yourself.
Step 3 – Turn on device inventory
In your Ploy dashboard, go to Settings → Desktop App and turn on Device inventory. It's off by default.
Once it's on, Ploy Desktop reports the apps, browser extensions, MCP servers and AI tools on each Mac where someone is signed in. The first report goes 5 to 15 minutes after the app opens. After that it reports when something changes, and about once a day even if nothing has. Employees see a line in the app's Settings saying it shares this.
Check it worked
On a test Mac:
Run
sudo defaults read "/Library/Managed Preferences/com.joinploy.desktop". It should print your subdomain.Look at the script's output in your MDM. The first run ends with
updated toand the version. Later runs sayup to date.The Ploy mark is in the menu bar. Click it: it goes straight to your company's sign-in, without asking for a subdomain.
Once someone has signed in with device inventory on, the Mac's apps appear in Ploy within about 15 minutes.
When a new version comes out, a managed Mac doesn't install it itself. Its Settings say a new version is available and that your IT team will roll it out. Your scheduled script does that.
Optional – Include browser extensions in device inventory
macOS doesn't let any app read browser folders without Full Disk Access. Without it, Ploy Desktop still reports apps, MCP servers and AI tools, but not browser extensions.
To include browser extensions, push a Privacy Preferences Policy Control (PPPC) payload with these values:
Field | Value |
|---|---|
Identifier |
|
Identifier type | Bundle ID |
Code requirement |
|
Service | Full Disk Access ( |
Access | Allow |
If the code requirement doesn't match exactly, macOS ignores the grant without saying so.
Think before you add this. Full Disk Access covers nearly every file on the Mac, not just browser folders, and macOS can't narrow it. Ploy Desktop only reads extension names and IDs from browser folders, and never opens history, cookies or saved passwords. Leave this step out if your security policy doesn't allow Full Disk Access for this kind of app.
Optional – Hide macOS's "Background item added" notice
The package adds a login item that opens Ploy at login, and macOS may tell employees about it. To pre-approve it, push a Managed Login Items payload (com.apple.servicemanagement) with a rule of type Label and the value com.joinploy.desktop.
Troubleshooting
Ploy asks for a subdomain. The profile hasn't arrived, or the subdomain in it is wrong. Check the Mac has it under System Settings → General → Device Management, then run the command in "Check it worked".
Employees see an Update button. The Mac has no Ploy profile, so the app thinks the employee installed it themselves. Push the profile.
The script says error: run this as root. Set your MDM to run the script as root.
The script says error: could not download. The Mac can't reach ploy-chrome-extension.s3.eu-west-2.amazonaws.com. Allow it in your firewall or proxy.
The script says the download does not verify with any of Ploy's keys. Your copy of the script is out of date. Copy it again from this page.
No apps appear in Ploy. Check that Device inventory is on, that someone is signed in to Ploy Desktop on that Mac, and allow 15 minutes. The app's log is at ~/Library/Logs/com.joinploy.desktop/ploy.log.
Removing Ploy Desktop
Removing the profile leaves the app installed. To remove the app, run this as root, then remove the profile in your MDM:
pkill -x ploy-desktop || true
rm -f /Library/LaunchAgents/com.joinploy.desktop.plist
rm -rf /Applications/Ploy.app
pkgutil --forget com.joinploy.desktop