{"id":13581101,"url":"https://github.com/sickcodes/osx-optimizer","last_synced_at":"2025-05-15T18:10:33.322Z","repository":{"id":36950573,"uuid":"378096792","full_name":"sickcodes/osx-optimizer","owner":"sickcodes","description":"OSX Optimizer: Optimize MacOS - Shell scripts to speed up your mac boot time, accelerate loading, and prevent unnecessary throttling.","archived":false,"fork":false,"pushed_at":"2024-05-25T12:58:30.000Z","size":45,"stargazers_count":1633,"open_issues_count":11,"forks_count":123,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-05-15T13:19:23.166Z","etag":null,"topics":["apple","boost","macos","optimization","osx","speed"],"latest_commit_sha":null,"homepage":"https://sick.codes","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sickcodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"sickcodes"}},"created_at":"2021-06-18T09:16:04.000Z","updated_at":"2025-05-14T07:12:02.000Z","dependencies_parsed_at":"2024-10-15T09:11:02.080Z","dependency_job_id":null,"html_url":"https://github.com/sickcodes/osx-optimizer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sickcodes%2Fosx-optimizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sickcodes%2Fosx-optimizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sickcodes%2Fosx-optimizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sickcodes%2Fosx-optimizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sickcodes","download_url":"https://codeload.github.com/sickcodes/osx-optimizer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254394724,"owners_count":22063984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apple","boost","macos","optimization","osx","speed"],"created_at":"2024-08-01T15:01:58.102Z","updated_at":"2025-05-15T18:10:33.276Z","avatar_url":"https://github.com/sickcodes.png","language":"Shell","readme":"# OSX-Optimizer\nOSX Optimizer: Optimize MacOS - Shell scripts to speed up your mac boot time, accelerate loading, and prevent unnecessary throttling.\n\nmacOS can be heavily modified using the `defaults` command. In fact, almost every option is accessible via `defaults`.\n\nA great way to see what ticking and unticking a box in the Settings App is by using:\n\n```bash\ndefaults read \u003e defaults.pre.txt\n\n# *make a change in Settings*\n\ndefaults read \u003e defaults.post.txt\n\ndiff defaults.pre.txt defaults.post.txt\n```\n\n# OSX Optimizations\n\nBelow you will find extremely good optimizers, particularly for virtual machines.\n\nSome of the commands are dangerous from a remote access perspective, but they will greatly optimize your VM.\n\n\n## Skip the GUI login screen (at your own risk!)\n```bash\ndefaults write com.apple.loginwindow autoLoginUser -bool true\n```\n\nUser accounts and root/administrator have different `defaults`\n\n## Disable spotlight indexing on macOS to heavily speed up Virtual Instances.\n\n```bash\n# massively increase virtualized macOS by disabling spotlight.\nsudo mdutil -i off -a\n\n# since you can't use spotlight to find apps, you can renable with\n# sudo mdutil -i on -a\n\n```\n\n## Enable performance mode\n\nTurn on performance mode to dedicate additional system resources for server applications.\n\nDetails: https://support.apple.com/en-us/HT202528\n\n```\n# check if enabled (should contain `serverperfmode=1`)\nnvram boot-args\n\n# turn on\nsudo nvram boot-args=\"serverperfmode=1 $(nvram boot-args 2\u003e/dev/null | cut -f 2-)\"\n\n# turn off\nsudo nvram boot-args=\"$(nvram boot-args 2\u003e/dev/null | sed -e $'s/boot-args\\t//;s/serverperfmode=1//')\"\n```\n\n## Disable heavy login screen wallpaper\n\n```bash\nsudo defaults write /Library/Preferences/com.apple.loginwindow DesktopPicture \"\"\n```\n\n## Reduce Motion \u0026 Transparency\n\n```bash\ndefaults write com.apple.Accessibility DifferentiateWithoutColor -int 1\ndefaults write com.apple.Accessibility ReduceMotionEnabled -int 1\ndefaults write com.apple.universalaccess reduceMotion -int 1\ndefaults write com.apple.universalaccess reduceTransparency -int 1\n```\n\n\n## Enable multi-sessions\n\n```bash\nsudo /usr/bin/defaults write .GlobalPreferences MultipleSessionsEnabled -bool TRUE\n\ndefaults write \"Apple Global Domain\" MultipleSessionsEnabled -bool true\n```\n\n## Disable updates (at your own risk!)\nThis will prevent macOS from downloading huge updates, filling up your disk space.\n\nDisabling updates heavily speeds up virtualized macOS because the qcow2 image does not grow out of proportion.\n\n```bash\n# as roots\nsudo su\ndefaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -bool false\ndefaults write com.apple.SoftwareUpdate AutomaticCheckEnabled -bool false\ndefaults write com.apple.commerce AutoUpdate -bool false\ndefaults write com.apple.commerce AutoUpdateRestartRequired -bool false\ndefaults write com.apple.SoftwareUpdate ConfigDataInstall -int 0\ndefaults write com.apple.SoftwareUpdate CriticalUpdateInstall -int 0\ndefaults write com.apple.SoftwareUpdate ScheduleFrequency -int 0\ndefaults write com.apple.SoftwareUpdate AutomaticDownload -int 0\n```\n\n## Enable `osascript` over SSH automatically without **sshd-keygen warning** and **full disk access**\n\n```bash\n\ndefaults write com.apple.universalaccessAuthWarning /System/Applications/Utilities/Terminal.app -bool true\ndefaults write com.apple.universalaccessAuthWarning /usr/libexec -bool true\ndefaults write com.apple.universalaccessAuthWarning /usr/libexec/sshd-keygen-wrapper -bool true\ndefaults write com.apple.universalaccessAuthWarning com.apple.Messages -bool true\ndefaults write com.apple.universalaccessAuthWarning com.apple.Terminal -bool true\n\n```\n\n## Disable screen locking\n\n```bash\ndefaults write com.apple.loginwindow DisableScreenLock -bool true\n```\n\n## Show a lighter username/password prompt instead of a list of all the users\n\n```bash\ndefaults write /Library/Preferences/com.apple.loginwindow.plist SHOWFULLNAME -bool true\ndefaults write com.apple.loginwindow AllowList -string '*'\n\n```\n\n## Disable saving the application state on shutdown\n\nThis speeds up boot as the session state (currently opened apps) are not running when you reboot.\n\nThis may be slower for you depending on what you are doing.\n\n```bash\ndefaults write com.apple.loginwindow TALLogoutSavesState -bool false\n```\n\nEnable AnyDesk automatically\n\n```bash\n\ndefaults write com.apple.universalaccessAuthWarning \"/Applications/AnyDesk.app\" -bool true\ndefaults write com.apple.universalaccessAuthWarning \"/Applications/AnyDesk.app/Contents/MacOS/AnyDesk\" -bool true\ndefaults write com.apple.universalaccessAuthWarning \"3::/Applications\" -bool true\ndefaults write com.apple.universalaccessAuthWarning \"3::/Applications/AnyDesk.app\" -bool true\ndefaults write com.apple.universalaccessAuthWarning \"com.philandro.anydesk\" -bool true\n\n```\n\n## Enable remote access (at your own risk!)\n\n```bash\nsudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart \\\n    -activate \\\n    -configure \\\n    -access \\\n    -off \\\n    -restart \\\n    -agent \\\n    -privs \\\n    -all \\\n    -allowAccessFor -allUsers\n```\n\n## Connect WiFi to strongest Access Point\nMake WiFi stay connected to the strongest(usually closest) AP avaliable.\n\nMacOS did not specify this behavior by default.\n\n```bash\nsudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport prefs JoinMode=Strongest\n```\n\n\n\n# EXTREMELY INSECURE METHODS (at your own risk!)\n\nThese macOS optimizations should only be used in CI/CD, behind a VPN, and with no external connectivity.\n\nThis is not a warning, it is absolutely essential, or anyone can just SSH into the remote mac.\n\nIf you do any of the below commands on a remote server, you will\n\n## Disable passwords globally\n\n- Everyone is now root\n- No need to type passwords\n- SSH login just hit enter for password\n\nAs root:\n\n```bash\nsudo su\n# nuke pam\nfor PAM_FILE in /etc/pam.d/*; do\n    sed -i -e s/required/optional/g \"${PAM_FILE}\"\n    sed -i -e s/sufficient/optional/g \"${PAM_FILE}\"\ndone\n```\n\n\n\nsudo killall Finder || true\nsudo killall Dock || true\nsudo killall mds\n\n\n## Make everyone a sudoer\n\n```bash\ncd /Users\n# add everyone to sudoers and import the control center plist\nfor REAL_NAME in *; do\n    echo \"${REAL_NAME}\"\n    tee \"/etc/sudoers.d/${REAL_NAME}\" \u003c\u003c\u003c \"${REAL_NAME}     ALL=(ALL)       NOPASSWD: ALL\"\n    # sudo -u \"${REAL_NAME}\" defaults write -globalDomain NSUserKeyEquivalents  -dict-add \"Save as PDF\\\\U2026\" \"@\\$p\";\n    sudo -u \"${REAL_NAME}\" sudo mdutil -i off -a\n    # sudo -u \"${REAL_NAME}\" defaults import com.apple.controlcenter /tmp/com.apple.controlcenter.plist\n    # sudo -u \"${REAL_NAME}\" defaults write \"/Users/${REAL_NAME}/Library/Preferences/.GlobalPreferences MultipleSessionEnabled\" -bool 'YES'\n    # sudo -u mdutil -i off -a\n    # sudo dscl . -create \"/Users/${REAL_NAME}\" UserShell \"${USERSHELL}\"\n    sudo -u \"${REAL_NAME}\" \"whoami\"\ndone\n#############################3\n\n```\n\n\n# Disable apps from going to sleep at all\nThis command will prevent applications from sleeping, completely in the background.\n\nYou can verify this using the `top` command and an App should never go into `sleeping` state.\n\nThis increases RAM usage, but means your apps, like Xcode, will spring into action.\n\n```bash\nsudo -u \"${REAL_NAME}\" sudo defaults write NSGlobalDomain NSAppSleepDisabled -bool YES\n```\n\n\n\n","funding_links":["https://github.com/sponsors/sickcodes"],"categories":["Shell","HarmonyOS"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsickcodes%2Fosx-optimizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsickcodes%2Fosx-optimizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsickcodes%2Fosx-optimizer/lists"}