Skip to content

hugomf/macosdevenv-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 

Repository files navigation

Development Environment Setup Macos

Step 1 - Download and Install CommandLine Tools for Xcode

Currently there are two options to install the CommandLine tools

  1. Open the Macos Terminal and type the following command:

    xcode-select --install
  2. Download CommandLine Tools from the website

    • Download CL Tools From: Apple Developer Site, you will have to login with your appleid (iCloud) account.

    • Search Command Line tools and download the desired version, for example:

      • Command Line Tools for Xcode 14.2 - Here
  3. Open the terminal and verify if the CommandLine Tools for Xcode installation was successful by entering the following command:

    xcode-select -p

Step 2 - Download and Install HomeBrew

Make sure CommandLine Tools for Xcode is installed.

  • Download and Install HomeBrew using the following command:

        /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Step 3 - Download, Install and configure iTerm2

  • Download and Install iterm2

  • Install OhmyZsh:

    sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
    
  • Install Powerlevel10k

    brew install romkatv/powerlevel10k/powerlevel10k
  • Configure Powerlevel10k on .zshrc

    echo "source $(brew --prefix)/opt/powerlevel10k/powerlevel10k.zsh-theme" >>~/.zshrc
  • Close the iterm2 window and open it again, a menu will appear.

  • Install MesloLGS NF font, configure the icons and the prompt attributes by following the instructions.

  • To install MesloLGS NF font manually:

    powerlevel10k should do that for you, this step should be done if the font is not installed properly.

    • macos:

        cd ~/Library/Fonts && { 
        curl -Lo 'MesloLGS NF Regular.ttf' 'https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf'
        curl -Lo 'MesloLGS NF Italic.ttf' 'https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf'
        curl -Lo 'MesloLGS NF Bold.ttf' 'https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf'
        curl -Lo 'MesloLGS NF Bold Italic.ttf' 'https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf'
        cd -; }
      

Note: If you are unable to see the icons, you may need to open the iterm2 Settings>Profiles>Text> and in the Font Section you will have to manually set the MesloLGS NF font.

Step 4 - Install version managers for Python, Java and Node

  • Install (Java Version Manager)

    • Install sdkman

      curl -s "https://get.sdkman.io" | bash
      
      source "$HOME/.sdkman/bin/sdkman-init.sh"
    • Verify sdkman version:

      sdk version
    • Usage:

        sdk list java                   # To list all available versions
        sdk list java | grep installed  # To see what versions are installed 
        sdk install java 8.0.362-tem    # Install a Java version
      
        sdk use java 8.0.362-tem        # To set Java version locally, you need to navigate to the project's directory
        sdk default java 8.0.362-tem    # Sets the specified version of Java as the default version.
      
      
        sdk current java                # Check current java version
  • Install nvm (Node Version Manager)

    • Type the following command to download an install nvm:

          curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
    • Close and reopen your terminal

    • Usage:

           nvm ls-remote       # To see all available node versions
           nvm ls              # If you want to list what versions are installed
           nvm install node    # To install the latest version of node
           nvm install 14.7.0  # To install a specific version of node
  • Install pyenv (Python version manager)

    Note: Make sure HomeBrew is installed (Follow Step 2), and then proceed to install pyenv as follows:

    • Install pyenv

      brew update
      brew install pyenv
    • Add the following configuration at the end of your .zshrc or .bashrc file

        export PYENV_ROOT="$HOME/.pyenv/shims"
        export PATH="$PYENV_ROOT:$PATH"
        export PIPENV_PYTHON="$PYENV_ROOT/python"
  • Usage:

    • Now you are able to install a python version locally or globally for example:

      pyenv versions        # To see what versions are installed.
      pyenv install -l      # Gives the list of all available versions.
      pyenv install 3.9.4   # just install
      pyenv global 3.9.4    # Sets a python version as the default (global) version.
      pyenv local 3.9.4     # use python version locally
      pyenv uninstall 3.94  # to uninstall
    • Check your python version

      python --version
  • Install gvm (GOLang version manager)

    Note: Make sure HomeBrew is installed (Follow Step 2), and then proceed to install gvm as follows:

    • Install any version of golang

      brew update
      brew install go  # Install any golang version (this is needed because binary versions are not available anymore)
      brew install mercurial # Version control tool to download "go source code" to compile the desired version
    • Install gvm (Use zsh or bash according your current shell system)

        zsh < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
  • Usage:

    • Now you are able to install a golang version locally or globally for example:

      gvm list                    # To list what versions are installed in your system.
      gvm listall                 # Gives the list of all available versions.
      gvm install go1.16          # Install a specific golang version
      gvm use go1.16 [--default]  # Sets the specified golang version as the default (global) version.
      gvm use go1.16              # use golang version locally
      gvm implode                 # to uninstall
    • Verify your golang version

        go version

Step 5 - Configure git (ssh keys)

  • Set up SSH keys:

    SSH keys allow you to securely connect to remote servers and repositories without entering a password every time. To set up SSH keys, follow the instructions in the GitHub documentation: SSH Keys Docs

Step 6 - Install AWS CLI

  • Open the terminal and type the following command(s):

    curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
    sudo installer -pkg AWSCLIV2.pkg -target /

Step 7 - Install Docker

Currently, there are two ways to install Docker in MacOS X:

  1. Install Docker Desktop from Docker's website: Although this is the easiest way, Docker Desktop is usually more heavyweight than Docker Client

  2. Install Colima and Docker CLI using HomeBrew

    • Follow the instructions from this Guide

Note: Follow this Link If you are trying to use Docker Compose or AWS SAM and if you are getting this error:

 dockerpycreds.errors.InitializationError: docker-credential-desktop not installed or not available in PATH
 [8929] Failed to execute script docker-compose

Step 8 - Install the following Applications

VSCode Plugins

Download the following Plugins:

UI

Development

Java Development

Python Development

Javascript, React, etc

Markdown edition

About

MacOS development environment setup cookbook

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published