Back

macOS tips for developer

Alias


alias show_tcp_port="lsof -nP -iTCP"
alias show_tcp_port_listen="lsof -nP -iTCP | grep LISTEN"

disable .DS_Store on network storage


defaults write com.apple.desktopservices DSDontWriteNetworkStores true

disable gatekepper for binary exec

e.g. perforce command p4


tian@mac-mini ~ % xattr -p com.apple.quarantine `which p4`
0082;5fb2322c;Safari;
tian@mac-mini ~ % xattr -d com.apple.quarantine `which p4`
xattr: [Errno 13] Permission denied: '/usr/local/bin/p4'
tian@mac-mini ~ % sudo xattr -d com.apple.quarantine `which p4`
Password:
tian@mac-mini ~ % xattr -p com.apple.quarantine `which p4`
xattr: /usr/local/bin/p4: No such xattr: com.apple.quarantine
tian@mac-mini ~ %

create macOS install usb disk


sudo /Applications/Install\ macOS\ Big\ Sur.app/Contents/Resources/createinstallmedia --volume /Volumes/UDISK --applicationpath /Applications/Install\ macOS\ Big\ Sur.app
Licensed under CC BY-NC-SA 4.0