Add spacer in the Dock on Mac

Run this command in the terminal for each space you want:

defaults write com.apple.dock persistent-apps -array-add ‘{tile-data={}; tile-type=”spacer-tile”;}’

Reload the Dock with this command:

killall Dock

Now you can move the spaces around in order to group your apps: