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:

Terminal
defaults write com.apple.dock tilesize -int 42 && killall Dock

Replace 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:

Terminal
defaults write com.apple.dock size-immutable -bool yes && killall Dock

This 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.

Patrik's Mac Dock with the divider between apps and folders
The divider on my Dock. Select the image to examine the full screenshot.

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:

Terminal
defaults write com.apple.dock magnification -bool yes &&
defaults write com.apple.dock largesize -int 46 &&
killall Dock

I 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.

Close-up of Patrik's Dock with a slight hover magnification effect
A close-up of the slight magnification I use. Select the image to enlarge it.

To stop accidental changes to the magnification switch and slider, run:

Terminal
defaults write com.apple.dock magnify-immutable -bool yes &&
defaults write com.apple.dock magsize-immutable -bool yes &&
killall Dock

Set 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:

Terminal
defaults write com.apple.dock size-immutable -bool no && killall Dock

Unlock the magnification switch and slider with:

Terminal
defaults write com.apple.dock magnify-immutable -bool no &&
defaults write com.apple.dock magsize-immutable -bool no &&
killall Dock

These locks affect the size controls. They do not prevent you from changing the Dock’s apps or its position.

Sources & further reading