Skip to content

It is a script to install all the tools I need for development on macOS.

Notifications You must be signed in to change notification settings

Chindada/macos_dev_setup

Repository files navigation

MACOS DEVELOPER SETUP

MAINTAINED RELEASE OS ARCH

Caution: This script is only for Apple silicon architecture mac

13.2.1

Project Structure

|-- README.md          # The file you are reading now
|-- assets             # Images
|-- fonts              # Fonts
|   |-- Hack           # Hack font
|   |-- JetBrainsMono     # JetBrainsMono font
|   |-- MesloLGS          # MesloLGS font
|   |-- Monoid            # Monoid font
|   |-- OperatorMono      # OperatorMono font
|   `-- SourceCodePro     # SourceCodePro font
|-- install.sh         # Main script
`-- scripts
    |-- 01_ohmyzsh.sh         # Install ohmyzsh
    |-- 02_homebrew.sh        # Install homebrew
    |-- 03_golang.sh          # Install golang
    |-- 04_flutter.sh         # Install flutter
    |-- 05_node.sh            # Install node
    |-- 06_python.sh          # Install python
    |-- 07_homebrew_utils.sh  # Install homebrew utils
    |-- 08_powerlevel10k.sh   # Install powerlevel10k
    |-- 09_fonts.sh           # Install fonts
    `-- 10_mas_apps.sh        # Install mas apps

Step 0: (Optional) CalDigit Thunderbolt Station Driver(TS3 Plus)

  • Skip this step, if you don't have CalDigit Thunderbolt Station
    1. Reduce secruity policy in recovery os Reference
    2. Downdload and manual install driver

Step 1: Install Xcode CLI tools

  • Execute below commands, step by step

    sudo xcode-select --install

Step 2: Directly Download

  • In this case, base folder is ~/dev_projects, you can change it to your own folder

    VERSION=1.5.1
    BASE_DIR=~/dev_projects
    mkdir -p $BASE_DIR
    curl -fSL https://github.com/Chindada/macos_dev_setup/archive/refs/tags/v$VERSION.zip -o macos_dev_setup.zip
    unzip -q macos_dev_setup.zip -d $BASE_DIR
    rm macos_dev_setup.zip
    mv $BASE_DIR/macos_dev_setup-$VERSION $BASE_DIR/macos_dev_setup
    cd $BASE_DIR/macos_dev_setup

Step 3: Install

  • Install and the output will be saved to $BASE_DIR/macos_dev_setup_output_$(date +%Y%m%d%H%M).txt

    BASE_DIR=~/dev_projects
    cd $BASE_DIR/macos_dev_setup
    ./install.sh 2>&1 | tee $BASE_DIR/macos_dev_setup_output_$(date +%Y%m%d%H%M).txt

Step 4: Post Install

zsh

  1. Launch iterm2, it will prompt to install MesloLGS font and initial powerlevel10k
    • if no install font, exit and restart until iterm2 prompt to install font
  2. Paste yyyy3121111121y1yy
    • The zsh will be like below

ITERM2

Xcode

  1. Run below commands

    sudo xcodebuild -license
    sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
    sudo xcodebuild -runFirstLaunch
  2. Manual launch Xcode, let it finish the first initial

Android Studio

  • Manual launch Android Studio, install Android SDK

    • Install Android SDK Command-line Tools
    • Install plugin flutter & dart

    Android SDK

    flutter doctor --android-licenses
    flutter doctor

SSH

  • Generate SSH key or import SSH key

    • If import, permission should be 600 chmod 600 ~/.ssh/id_ed25519
    • If new, add SSH key to github
    ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -q -N "" -C "[email protected]"
    eval "$(ssh-agent -s)"
    
    touch ~/.ssh/config
    echo 'Host *
      AddKeysToAgent yes
      UseKeychain yes
      IdentityFile ~/.ssh/id_ed25519
      StrictHostKeyChecking no' >~/.ssh/config
    
    ssh-add --apple-use-keychain ~/.ssh/id_ed25519
    cat ~/.ssh/id_ed25519.pub

    Note: The --apple-use-keychain option stores the passphrase in your keychain for you when you add an SSH key to the ssh-agent. If you chose not to add a passphrase to your key, run the command without the --apple-use-keychain option.

    The --apple-use-keychain option is in Apple's standard version of ssh-add. In MacOS versions prior to Monterey (12.0), the --apple-use-keychain and --apple-load-keychain flags used the syntax -K and -A, respectively. If you don't have Apple's standard version of ssh-add installed, you may receive an error. For more information, see "Error: ssh-add: illegal option -- K."

GPG Key

  • Generate GPG key
    • There should not be any key before generate
gpg --full-generate-key

GPG

  • Export GPG key and set git config

    SEC_KEY_ID=$(gpg --list-secret-keys --with-colons | awk -F: '$1 == "sec" {print $5}')
    gpg --armor --export $SEC_KEY_ID
    git config --global user.signingkey $SEC_KEY_ID
    git config --global gpg.program gpg
    git config --global commit.gpgsign true
    git config --global tag.gpgSign true
  • Test GPG sign

    echo "test" | gpg --clearsign

Step 5: Final check

  • (Optional) If you want to contribute to this project, you can clone it using SSH

    BASE_DIR=~/dev_projects
    git clone [email protected]:Chindada/macos_dev_setup.git $BASE_DIR/macos_dev_setup
  • Check the version of installed tools

    brew --version
    go version
    flutter --version
    node --version
    python3 --version
    git config --list

References

  1. iTerm2 Themes

Author

About

It is a script to install all the tools I need for development on macOS.

Topics

Resources

Stars

Watchers

Forks

Languages