-
-
Save platypython/ae294f3f1152f62377003d5c473042cf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # --- macOS Tahoe Setup Script (M-Series Only) --- | |
| # Updated: March 2026 | |
| echo "Starting Mac setup for Apple Silicon..." | |
| # 1. Install Xcode Command Line Tools (Headless/Auto-accept) | |
| if ! xcode-select -p &> /dev/null; then | |
| echo "Installing Xcode Command Line Tools..." | |
| # Create a temporary file to trick the installer into thinking the license is accepted | |
| touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress | |
| # Find the latest CLI tools for Tahoe via softwareupdate | |
| PROD=$(softwareupdate -l | grep "\*.*Command Line" | tail -n 1 | awk -F"*" '{print $2}' | sed -e 's/^ *//' | tr -d '\n') | |
| if [ -n "$PROD" ]; then | |
| echo "Installing $PROD..." | |
| sudo softwareupdate -i "$PROD" --verbose | |
| else | |
| echo "Could not find CLI tools via softwareupdate. Falling back to manual trigger." | |
| xcode-select --install | |
| read -p "Press [Enter] after the manual install finishes..." | |
| fi | |
| rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress | |
| fi | |
| # Auto-accept the license (requires sudo) | |
| echo "Accepting Xcode license..." | |
| sudo xcodebuild -license accept | |
| # 2. Install Homebrew (Hardcoded for /opt/homebrew) | |
| if ! command -v brew &> /dev/null; then | |
| echo "Installing Homebrew..." | |
| /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
| # Set up environment for M-series (Apple Silicon path) | |
| echo "Configuring Homebrew environment..." | |
| (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> ~/.zprofile | |
| eval "$(/opt/homebrew/bin/brew shellenv)" | |
| fi | |
| # 3. Update and Upgrade | |
| echo "Updating Homebrew..." | |
| brew update && brew upgrade | |
| # 4. Applications and Tools | |
| # Optimized for your specific M-series hardware | |
| echo "Installing packages..." | |
| PACKAGES=( | |
| git | |
| python | |
| node | |
| ffmpeg # Highly recommended for M-series media workflows | |
| fastlane | |
| ) | |
| CASKS=( | |
| visual-studio-code | |
| iterm2 | |
| google-chrome | |
| docker # Ensure you get the Apple Silicon version | |
| rectangle # Window management for large screens | |
| ) | |
| brew install "${PACKAGES[@]}" | |
| brew install --cask "${CASKS[@]}" | |
| # 5. M-Series Specific Optimization | |
| # Ensure Rosetta 2 is installed for older Intel-only apps | |
| echo "Ensuring Rosetta 2 is available..." | |
| sudo softwareupdate --install-rosetta --agree-to-license | |
| # 6. Cleanup | |
| echo "Cleaning up..." | |
| brew cleanup | |
| echo "Setup complete! Restart your Terminal to begin." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment