Wesley de Groot's Blog
MacOS Terminal Commands

Back

In this post i'll show you my favorite macOS terminal commands that i use often or find interesting.
This blog post is a different kind of post than i usually write, but i hope you like it.

Enable/Disable beta updates

Description Command
Enroll developer seed sudo /System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil enroll DeveloperSeed
Enroll public seed sudo /System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil enroll PublicSeed
Unenroll seeds
(stop receiving beta updates)
sudo /System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil unenroll

Xcode

Description Command
Debug/Internal Xcode defaults write com.apple.dt.Xcode ShowDVTDebugMenu -bool YES
sudo mkdir -p /Applications/Xcode.app/Contents/Developer/AppleInternal/Library/Xcode/
sudo touch /Applications/Xcode.app/Contents/Developer/AppleInternal/Library/Xcode/AppleInternal.plist
Disable Xcode Cloud defaults write com.apple.dt.Xcode XcodeCloudUpsellPromptEnabled -bool false
Use 4 spaces for indentation defaults write com.apple.dt.Xcode DVTTextIndentWidth -int 4
Use spaces instead of tabs defaults write com.apple.dt.Xcode DVTTextIndentUsingTabs -bool NO
Show the sidebar for indentation depth defaults write com.apple.dt.Xcode DVTTextShowFoldingSidebar -bool YES
Show the full stack trace in the sidebar defaults write com.apple.dt.Xcode IDEAlwaysShowCompressedStackFrames -bool NO
Show file extensions defaults write com.apple.dt.Xcode IDEFileExtensionDisplayMode -int 1
Show up to 30 lines of detail in the issue navigator defaults write com.apple.dt.Xcode IDEIssueNavigatorDetailLevel -int 30
Show up to 30 lines of detail when searching defaults write com.apple.dt.Xcode IDESearchNavigatorDetailLevel -int 30
Show the build number in the app icon defaults write com.apple.dt.Xcode DVTEnableDockIconVersionNumber -bool YES
Does the above, and show a debug menu, but useless because of the above an the latter has more checks defaults write com.apple.dt.Xcode ShowDVTDebugMenu -bool YES
Show details on indexing progress defaults write com.apple.dt.Xcode IDEIndexerActivityShowNumericProgress -bool true

Simulator

Description Command
Show touches simulator defaults write com.apple.iphonesimulator ShowSingleTouches 1

Finder

Description Command
Enable display of filename extensions defaults write NSGlobalDomain AppleShowAllExtensions -bool true
Disable the warning when changing a file extension defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
Show hidden files by default defaults write com.apple.Finder AppleShowAllFiles -bool true
Disable smart quotes and smart dashes
they are annoying when typing code
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
Open finder window in ~/Developer defaults write com.apple.finder NewWindowTargetPath -string "file://$HOME/Developer/"
Finder in column view defaults write com.apple.finder FXPreferredViewStyle Clmv
Allow text selection in Quick Look defaults write com.apple.finder QLEnableTextSelection -bool TRUE
Check for software updates daily, not just once per week defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
Setting screenshots location to ~/Desktop/screenshots defaults write com.apple.screencapture location -string "$HOME/Desktop/screenshots"
I do this because i run a script that automatically imports screenshots to photos.
LaunchAgent and [The shortcut][https://www.icloud.com/shortcuts/2c7c5cb4a4574437af66623b75521b16]
Setting screenshot format to PNG defaults write com.apple.screencapture type -string "png"

Safari

Description Command
Show the full URL in the address bar defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true
Enable the Develop menu and the Web Inspector defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
defaults write com.apple.Safari IncludeDevelopMenu -bool true
Enabling Safari's bookmarks bar by default defaults write com.apple.Safari ShowFavoritesBar -bool true
Enable the Develop menu and the Web Inspector in Safari defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
defaults write com.apple.Safari IncludeDevelopMenu -bool true
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true
Add a context menu item for showing the Web Inspector in web views defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
Warn about fraudulent websites defaults write com.apple.Safari WarnAboutFraudulentWebsites -bool true
Enable “Do Not Track” defaults write com.apple.Safari SendDoNotTrackHTTPHeader -bool true
Update extensions automatically defaults write com.apple.Safari InstallExtensionUpdatesAutomatically -bool true
Do not automatically open "safe" files after downloading defaults write com.apple.Safari AutoOpenSafeDownloads -bool false

Photos

Description Command
Prevent Photos from opening automatically when devices are plugged in defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true

Mission Control

Description Command
Bottom left screen corner → Put to sleep defaults write com.apple.dock wvous-bl-corner -int 10
Bottom right corner → do nothing defaults write com.apple.dock wvous-bl-modifier -int 0

(0: no-operation, 2: Mission Control, 3: Show application windows, 4: Desktop, 5: Start screen saver, 6: Disable screen saver, 7: Dashboard, 10: Put display to sleep, 11: Launchpad, 12: Notification Center, 13: Lock Screen)

AppKit

Description Command
Show an internal AppKit debug menu defaults write -g _NS_4445425547 -bool YES

Read more

Share


Share Mastodon Twitter LinkedIn Facebook
x-twitter mastodon github linkedin discord threads instagram whatsapp bluesky square-rss sitemap