Run the command in terminal and spacer is added to the Dock automatically.
Add spacer to block
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'; killall Dock
Add small spacer to Dock
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="small-spacer-tile";}'; killall Dock
![](https://viklund.fi/wp-content/uploads/2023/10/image-1-1024x98.png)