Skip to main content
macOS

macOS #

Useful Software #

Setting #

Runtime/Internet #

Microphone/Camera #

Shell #

System Info #

Find main board ID:

ioreg -l | grep board-id

Find Mac model ID:

sysctl hw.model

Find MAC address:

ifconfig en0 | grep ether

Allow app downloads from anywhere #

Credit: How to allow apps downloaded from anywhere on Mac

sudo spctl --master-disable

Solve “App is damaged and can’t be opened” #

Credit: macOS Catalina: “App is damaged and can’t be opened. You should move it to the trash.” - Ask Different

sudo xattr -rd com.apple.quarantine "path/to/file.app"

Useful Operations #

Restart Quick Look:

killall -9 -v QuickLookUIService

Restart Touch Bar:

pkill "Touch Bar agent"; killall "ControlStrip"

When trackpad is malfunctioning:

killall Dock

Find and delete all .DS_Store files in current folder: (credit)

find . -name '.DS_Store' -type f -delete

Fix Xcode hanging in Terminal: (credit)

sudo xcodebuild -license accept

Restart bluetooth service: (requires blueutil, credit)

blueutil -p 0 && sleep 1 && blueutil -p 1

Advanced Settings #

Check SIP status:

csrutil status
# System Integrity Protection status: enabled.

Enable three-finger dragging: (credit)

defaults write com.apple.AppleMultitouchTrackpad TrackpadThreeFingerDrag 1 && defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadThreeFingerDrag 1

Show hidden files: (credit)

defaults write com.apple.finder AppleShowAllFiles 1

Turn off Power Chime: (credit)

defaults write com.apple.PowerChime ChimeOnNoHardware 0
killall PowerChime

Make hidden apps’ icon transparent in the dock: (credit)

defaults write com.apple.dock showhidden 1
killall Dock

Show Safari develop & debug menu item: (credit)

defaults write com.apple.Safari IncludeDebugMenu 1
defaults write com.apple.Safari IncludeInternalDebugMenu 1

Disable elastic scrolling in Safari: (credit)

defaults write -g NSScrollViewRubberbanding 0

Find Third Party Kernel Extensions #

Credit

kextstat | grep -v com.apple

Danger Zone #

Remove Snapz Pro #

Credit

sudo kextunload -b com.AmbrosiaSW.AudioSupport

cd /Library/Extensions/
sudo rm -r AmbrosiaAudioSupport.kext # r for recursive

cd /Library/LaunchDaemons/
sudo rm com.ambrosiasw.ambrosiaaudiosupporthelper.daemon.plist

cd ~/Library/Containers/
sudo rm -r com.ambrosiasw.snapz-pro-x

Edit Launch Items #

(credit 1, 2)

  • PID: running
  • Status:
    • 0 = finished
    • Positive = error
    • Negative = terminated
# Find
launchctl list | grep epicgames
# PID     Status  Label
# -       1       com.epicgames.launcher

# Remove
launchctl remove com.epicgames.launcher

Edit File Status #

Reference: How to remove driver and kexts on Mac? : SteamController

When some file cannot be accessed by Homebrew:

sudo chown -R $(whoami) $(brew --prefix)/*

Edit Host File #

sudo subl /private/etc/hosts