Certain OSX apps seem to have a tendency to stick around in the Dock, even though there's no user-facing setting to prevent this behavior. Is there a defaults command that prevents apps from enabling "Keep in Dock?"

I know about defaults write com.apple.dock persistent-apps -array (intentionally empty), but this has to be run manually, and repeatedly. Any ideas?

  • How do You quit an app? If it was not kept in Dock before opening, hitting ⌘CMD + Q to close an app should remove icon form the Dock. – Mateusz Szlosek Jan 20 '16 at 18:58
  • 1
    To date (27 March, 2019) each of the answers here fails the actually does something test. I know this comment sounds negative, because it is, but at the same time maybe it can save somebody some disappointment. – Michael Wolf Mar 27 '19 at 15:42
  • @MichaelWolf The highest voted answer (by @Shrihari) does what the OP is looking for. The question assumes that no UI exists to prevent the keep-in-dock behavior, thus they ask for a defaults command. That UI does exist tho and does exactly what is desired here. – Constablebrew May 22 '19 at 6:11
  • @Constablebrew It doesn't. If you move an open app's position in the dock and then quit the app, its icon stays there, even if you have unchecked the option mentioned. – Michael Wolf May 22 '19 at 16:46
  • 1
    @MichaelWolf Dragging an icon is explicitly setting its position, thus saving it to the dock (and over-riding any preferences). Setting the preference to not show recent apps in dock and also not dragging an app icon does just what OP is asking for - the app icon goes away when the app is closed. – Constablebrew Jul 12 '19 at 0:25

I think I understand your problem.. Open System Preferences, Click on dock, uncheck "Show recent applications in dock". This should probably solve your problem.

| improve this answer | |
  • 2
    The feature didn't exist in 2016. – William T Froggard Apr 14 '19 at 2:08
  • 1
    This is the right answer – Constablebrew May 22 '19 at 6:08
  • 3
    What an insane and inane, dock cluttering, idiotic feature. Thank you so much! – Thomson Comer May 4 at 16:15
  • 2
    This setting enabled itself when I upgraded from High Sierra to Catalina – allicarn May 6 at 16:02
  • Catalina didn't exist in 2018 ;) Seriously I discovered it when Blizzard games keep re-inserting into the dock; you start them via Battle.Net because it provides persistent login and you don't have to find your phone to give it an authentication code. – Harper - Reinstate Monica Nov 19 at 3:00

It seems like in Mojave (10.14) the following will do the trick:

defaults write com.apple.dock show-recents -bool no
defaults write com.apple.dock recent-apps -array # intentionally empty
| improve this answer | |

Either the app needs to be quit with command+q, or you need to just drag the icon out of the dock, and it'll be gone.

| improve this answer | |
  • No, there is a right click, "Remove from dock" item. I'm asking for preventing this from even being kept in the dock to begin with. – Kevin Suttle Jan 20 '16 at 19:56
  • 2
    @KevinSuttle it's not supposed to be. The only way it would happen is if the app's dock icon gets moved, or you right click on it and tell it to stay there. – William T Froggard Jan 20 '16 at 19:59
  • Aha, the "if the app's dock icon gets moved" is the trigger. I wonder if that behavior can be prevented. – Kevin Suttle Jan 20 '16 at 20:13
  • 1
    @WilliamTFroggard Our IT dept uses a utility called MacManage that will re-add the icon to the dock every 15 minutes, even if manually quit and unchecking keep in dock. – nipponese Apr 11 '19 at 16:56
  • @nipponese are you serious? – Nicholas Hamilton Oct 28 '19 at 7:04

Even after the below configuration, some applications might still run in background (. symbol in dock) & appears in dock

Open System Preferences, Click on dock, uncheck "Show recent applications in dock"

For instance, terminal/iterm2 they do not disappear from dock when closing from window.

For disappearing the application from dock, Command key, ⌘ + Q

so basically, some applications like in launchpad close immediately from dock as soon as they are closed from window but, if they don't disappear from dock then ⌘ + Q will be the solution

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .