Sometimes when opening apps I get duplicate icons in the Dock for that app. This isn't really a problem, however I'm curious why macOS does this (I suppose this is more of a technical question).

This happens a lot especially with VS Code where I often launch the app with the code utility in the Terminal.

Why does macOS think these are different apps when they're the same binary?

Dock screenshot

  • 1
    Do you have the Show recent applications in Dock checkbox checked in System Preferences > Dock? – IconDaemon Feb 24 at 0:19
  • I think this is dependent on the app and how it is started. If there are two seperate instances of the app, there will be 2 icons. – Gilby Feb 24 at 2:08
  • @IconDaemon Yes but that only controls whether the 3 last recently used apps get shown in the small group second from the right. If I turn that off an open VS code then it'll open in a separate icon and not the one I have pinned. – Decade Moon Feb 24 at 5:31
  • @IconDaemon And why would VS code appear in the recently used apps group when it is already pinned to the Dock? That shouldn't happen. – Decade Moon Feb 24 at 5:35
  • OK. That doesn't explain it. Perhaps Gilby has a clue as to what is happening. – IconDaemon Feb 24 at 12:09

I don't have a specific answer as to what causes macOS to do this, however there is an issue on the VS Code GitHub repository which has lots of discussions about this (for VS Code app at least).

It seems to have something to do with launching an app directly (executing the binary inside XYZ.app/Contents/MacOS) instead of via Launch Services (the open command).

  • You have answered your own question - I like that!! Just to confirm, I can get extra instances (and extra icons) for Safari by saying open /Applications/Safari.app/Contents/MacOS/Safari in Terminal. But open /Applications/Safari.app just opens the existing Safari window. – Gilby Feb 25 at 7:06

Passing the -n flag when using the open command opens multiple instances of an app. For example, running open -n -a Terminal several times will open multiple instances of the terminal app, as seen below


Terminal -> killall Dock

Right click the icon> Show in Finder. Pull up the icon then it disappears

You must log in to answer this question.

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