Dock removal question

macmanmk
Contributor

We had to configure machines for a short-term training environment. It involved installation of two applications and creation of Dock items for both of the apps, which went off without a hitch via a setup policy. When the training sessions ended, I configured a policy to remove the apps and the Dock icons.

The policy executed rm commands to remove the apps and I used the same Dock Items entries to try and remove the icons. I watched the Dock refresh as the policy ran, but the Dock icons remained after the policy completed. Am I doing something wrong?

1 REPLY 1

mm2270
Legendary Contributor III

Have you done a restart or logout/login since running it? Or just kill the Dock again? In my experience, the Dock settings tend to be kind of resilient and sometimes just don't get reflected properly until something more drastic happens, or the Dock restarts a second time. You could also killall cfprefsd and then killall Dock to see if that helps.

You can actually see if the items are in the Dock plist yourself by running something like this from Terminal while on the device.

defaults read com.apple.Dock | grep "file-label"

That should show all the items that the Dock.plist is aware of as being present for the persistent apps and folders. If you don't see the applications in the list, then it's just a case of the Dock not properly refreshing from the plist when it restarted. It happens.