I kept catching the Dock’s divider while using my Mac. The icons changed size, I put them back, and then it happened again. It got on my nerves, so I looked for a way to choose an exact size and stop changing it by accident.
These are the Terminal commands I use. I’ve used them on macOS Tahoe 26.6.2 and on a version before macOS 26. The numbers below are examples; choose sizes that suit your screen.
Set the icon size
This sets the regular Dock icons to 42 pixels:
defaults write com.apple.dock tilesize -int 42 && killall DockReplace 42 with any size from 16 to 128 pixels. The Dock disappears briefly while macOS restarts it.
Stop accidental resizing
Once the size feels right, lock it:
defaults write com.apple.dock size-immutable -bool yes && killall DockThis locks the Dock’s Size control. On my Mac, it also stopped the divider from changing the icon size when I caught it by accident. You can still change the size later: unlock it first, then run the size command again.
Set and lock magnification
Magnification makes an icon grow when the pointer moves over it. To turn it on and set the hover size to 46 pixels, run:
defaults write com.apple.dock magnification -bool yes && defaults write com.apple.dock largesize -int 46 && killall DockI like the hover effect to stay subtle. With regular icons at 42 pixels, 46 gives me a small change. You can choose a larger value if you want a more visible effect. Apple documents the same 16 to 128 pixel range for this setting.
To stop accidental changes to the magnification switch and slider, run:
defaults write com.apple.dock magnify-immutable -bool yes && defaults write com.apple.dock magsize-immutable -bool yes && killall DockSet the hover size before locking it. If you do not use magnification, you can skip both commands in this section.
Change the settings again
Unlock the regular icon size with:
defaults write com.apple.dock size-immutable -bool no && killall DockUnlock the magnification switch and slider with:
defaults write com.apple.dock magnify-immutable -bool no && defaults write com.apple.dock magsize-immutable -bool no && killall DockThese locks affect the size controls. They do not prevent you from changing the Dock’s apps or its position.