hide-finder-trash-dock-icons icon indicating copy to clipboard operation
hide-finder-trash-dock-icons copied to clipboard

DockMenus.plist in not editable in MacOS 12.2

Open ivorynoise opened this issue 2 years ago • 4 comments

The file cannot be edited with sudo privileges

$ PL="/System/Library/CoreServices/Dock.app/Contents/Resources/DockMenus.plist"&& sudo -- defaults write $PL finder-running -array-add  '<dict><key>command</key><integer>1004</integer><key>name</key><string>REMOVE_FROM_DOCK</string></dict>'

2022-07-23 15:17:38.969 defaults[66687:5083525] Could not write domain /System/Library/CoreServices/Dock.app/Contents/Resources/DockMenus.plist; exiting

Spent few hours but no luck :(

ivorynoise avatar Jul 23 '22 09:07 ivorynoise

Did you try turning off SIP (System Integrity Protection)?: https://stackoverflow.com/questions/32590053/copying-file-under-root-got-failed-in-os-x-el-capitan-10-11

I haven't yet tested on macOS 12.2.

On my MacBook Air running macOS High Sierra (v10.13.6) it's essentially this to change SIP:

1.) Reboot and hold down CMD+r, go to Terminal, "csrutil disable", "reboot". 2.) Do the stuff and things. 3.) Turn SIP back on: "csrutil enable", "reboot".

I hope that helps <3.

jesscxc avatar Jul 27 '22 11:07 jesscxc

If that helps I'll add to the README :)

jesscxc avatar Jul 27 '22 11:07 jesscxc

@jesscxc I tried it, and it did not work :(

Turning off the SIP is relatively hard on Mac Monterey. I followed the following steps to turn it off.

  1. Shut down the Mac
  2. Press and hold the power button to access the startup settings.
  3. Hit options. This will take you to macOS recovery.
  4. Once you are in recovery, hover over the Apple logo in the menu bar and hit “STARTUP DISK” choose the one where your main OS is and restart. Keep holding the Power button until the system is off
  5. Press the power button and keep holding it to open recovery again, and voila, you can access “startup security utility” properly.

Ref:

  1. https://discussions.apple.com/thread/253397576
  2. https://apple.stackexchange.com/questions/431329/cant-change-system-security-settings-in-new-macbook-pro-m1-monterey-startup-rec

I was successfully able to disable the SIP. In normal mode, csrutil status reported disable.

However, sudo vim /System/Library/CoreServices/Dock.app/Contents/Resources/DockMenus.plist can only open in RO mode.

ivorynoise avatar Jul 29 '22 08:07 ivorynoise

That's a bummer.

cocoonkid avatar Sep 27 '22 06:09 cocoonkid

@ivorynoise It turns out after MacOS Catalina the system files are stored on a whole different volume which is read-only, so there is no way (even with disabling SIP, which I also tried) to edit any of the files there...

reference

benjaminhera avatar Jun 07 '23 22:06 benjaminhera

@benjaminhera that's a restriction from MacOS. Marking this issue as closed.

ivorynoise avatar Jun 11 '23 06:06 ivorynoise