defaults commandShort answer: every Dock setting lives in com.apple.dock, and every
change needs killall Dock afterwards or nothing happens.
This page lists every key worth knowing, what values it takes, and what it actually does. It is a reference, not a tutorial, so skip to whichever row you came for.
Two commands. The first writes the setting, the second restarts the Dock so it picks the setting up:
defaults write com.apple.dock tilesize -int 48; killall Dock
Without killall Dock the value sits in the preference file doing nothing. That is the
single most common reason a command from a blog post appears not to work. See
what killall Dock does if you want the detail.
Before you change something, read what it is now, so you can put it back:
defaults read com.apple.dock tilesize
If a key has never been set, defaults read returns an error rather than a value. That is
normal, and it means the Dock is using the built-in default. To go back to that state, delete the key
rather than guessing at the original number:
defaults delete com.apple.dock tilesize; killall Dock
tilesize is the one everybody wants. It is the icon size in points, and the System
Settings slider writes the same value.
defaults write com.apple.dock tilesize -int 48; killall Dock
tilesize integer, 16 to 128. The slider in System Settings only
covers 16 to 128 as well, but typing the number is how you land on an exact size and get back to it
later.magnification boolean. Whether icons grow as the pointer passes
over them.largesize integer, up to 128. How big they grow when magnification
is on. Ignored entirely when it is off.Worth knowing: the Dock happily accepts a tilesize above 128 from the command line and
then clamps it on the next launch, so do not treat a larger number as a hidden feature.
orientation string, left, bottom or
right. There is no top. macOS has never supported it.autohide boolean. Whether the Dock hides until you push into the
edge.autohide-delay float, seconds. How long the pointer must sit at the
edge before the Dock appears. Set it to 0 for instant.autohide-time-modifier float. How long the slide animation takes.
0.15 is quick, 0 removes the animation.The pair people actually want is an instant Dock:
defaults write com.apple.dock autohide-delay -float 0
defaults write com.apple.dock autohide-time-modifier -float 0
killall Dock
These are the keys this site exists because of. Each one makes the matching control in System Settings stop responding, so the setting cannot be changed by accident, by another app, or by you in six months when you have forgotten.
defaults write com.apple.dock size-immutable -bool true
defaults write com.apple.dock position-immutable -bool true
defaults write com.apple.dock contents-immutable -bool true
defaults write com.apple.dock autohide-immutable -bool true
killall Dock
size-immutable freezes the size, and with it the drag handle on the
divider, which is what most people are actually trying to stop.position-immutable freezes which edge the Dock sits on.contents-immutable stops icons being dragged out, dropped in or
reordered.autohide-immutable freezes the hide and show setting. This is the
one most guides leave out.Swap true for false to release any of them. Our
command generator writes the exact set for whichever locks you pick,
including the undo commands. A fuller comparison of the approaches is in
three ways to lock the Mac Dock.
These four are per user and undoable. A configuration profile is the version that survives Terminal and a restart, and it is the right tool for a Mac other people use and the wrong one for your own.
show-recents boolean. The recent applications section on the right.
Setting it to false is the fix people search for most after upgrading.static-only boolean. When true, the Dock shows only applications
that are currently running and hides every pinned icon. A genuinely different way to work.persistent-apps array. The pinned applications. Editing this by
hand is possible and unpleasant; dragging is easier.persistent-others array. The folders and stacks on the right of the
divider.show-process-indicators boolean. The dot under a running app.To empty the Dock of pinned apps completely, leaving only what is running:
defaults write com.apple.dock persistent-apps -array; killall Dock
mineffect string, genie, scale or
suck. The minimize animation. suck has never appeared in System Settings
and has worked for over fifteen years.minimize-to-application boolean. Whether a minimized window tucks
into its app icon instead of sitting separately on the right.launchanim boolean. The bouncing icon while an app opens.scroll-to-open boolean. Scroll up on an icon to open Exposé
for that app.expose-group-apps boolean. Whether Mission Control groups windows
by application.mru-spaces boolean. Whether Spaces reorder themselves by most
recent use. Set it to false to keep your desktops in a fixed order, which is the other
half of a desktop that stays put.| Key | Type | What it does |
|---|---|---|
tilesize | int 16–128 | Icon size |
magnification | bool | Grow icons on hover |
largesize | int | Magnified size |
orientation | left/bottom/right | Which edge |
autohide | bool | Hide until needed |
autohide-delay | float | Delay before showing |
autohide-time-modifier | float | Slide speed |
size-immutable | bool | Lock the size |
position-immutable | bool | Lock the edge |
contents-immutable | bool | Lock the icons |
autohide-immutable | bool | Lock hide and show |
show-recents | bool | Recent apps section |
static-only | bool | Running apps only |
persistent-apps | array | Pinned apps |
persistent-others | array | Folders and stacks |
show-process-indicators | bool | Running dots |
mineffect | genie/scale/suck | Minimize animation |
minimize-to-application | bool | Minimize into the icon |
launchanim | bool | Bounce on launch |
scroll-to-open | bool | Scroll for Exposé |
expose-group-apps | bool | Group by app |
mru-spaces | bool | Reorder Spaces by use |
To throw away every Dock setting you have ever changed and return to a factory Dock:
defaults delete com.apple.dock; killall Dock
This is not reversible and it does discard work. Your pinned apps, your stacks, your size, all of it. If you only want to undo one thing, delete that one key instead. There is more on this in how to reset the Mac Dock.
Almost always a missing
killall Dock. The value is written, the running Dock has not re-read it. The other cause
is a typo in the key name: defaults accepts any key you invent and writes it happily,
because it has no idea which keys the Dock understands.
Yes. They live in your user preferences, not in the system, so an update leaves them alone. A migration to a new Mac carries them across too.
No, and you should not use it. These are per user
settings. Running them with sudo writes to root's preferences instead of yours, which
looks like the command silently failing.
Yes, and that is what the four
immutable keys are for. Any app with your permissions can write to
com.apple.dock; the locks are what stop the change taking effect.
Still Dock is the same four locks as switches in your menu bar, plus the one thing the commands do not have: it remembers the Dock you had before you locked it, so you can always get back to it. Locking the size is free.