Skip to content

kairosys/macos-dev-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 

Repository files navigation

macOS Development Environment

Table of Contents

1. macOS Configuration

  • iTerm2
  • Homebrew
    • Install Homebrew
      $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    • Run these commands in your terminal to add Homebrew to your PATH:
      $ echo >> ~/.zprofile
      $ echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
      $ eval "$(/opt/homebrew/bin/brew shellenv)"
    • Run the following command to confirm your installation
      $ brew help

2. Visual Studio Code

  • Download VS Code
  • Insall VS Code Extenstions:
    • Python
    • Extension Pack for Java
    • Spring Boot Extension Pack
    • Prettier - Code formatter
    • Rainbow CSV
    • GitLens — Git supercharged
    • Markdown All in One
    • Markdown Preview Mermaid Support
    • CodeSnap

3. Podman Desktop

  • Podman Desktop for macOS
    $ brew install podman-desktop
    Brew will also install the Podman Engine along with the Podman Desktop application, in case you don't have it installed yet.
  • Open Podman Desktop Application within the Applications directory, onboarding for the following extensions:
    • Podman
    • kubectl CLI
    • Compose
  • Run a very basic httpd server (named basic_httpd) that serves only its index page.
    $ podman run --name basic_httpd -dt -p 8080:80/tcp docker.io/nginx
  • Open in browser: http://localhost:8080
  • Stop and remove the httpd container:
    $ podman stop basic_httpd
    $ podman rm basic_httpd

4. Git

  • Download for macOS
    $ brew install git
  • Check the current version of Git:
    $ git -v
  • Getting Started - First-Time Git Setup
    • View all Git settings:
      $ git config --list --show-origin
    • Setup Identity:
      $ git config --global user.name "Your Name"
      $ git config --global user.email [email protected]
  • Generating a new SSH key
    • Generating a new SSH key:
      $ ssh-keygen -t ed25519 -C "[email protected]"
    • When you're prompted to "Enter a file in which to save the key", you can press Enter to accept the default file location.
    • At the prompt, type a secure passphrase.
    • Start the ssh-agent and add SSH private key to the agent:
      $ eval "$(ssh-agent -s)"
      $ ssh-add ~/.ssh/id_ed25519
  • Adding SSH key to the ssh-agent
    • First, check to see if your ~/.ssh/config file exists in the default location.
      $ open ~/.ssh/config
      The file /Users/kevin/.ssh/config does not exist.
    • If the file doesn't exist, create the file.
      $ vi ~/.ssh/config
    • Modify the file to contain the following lines.
      Host github.com
        AddKeysToAgent yes
        UseKeychain yes
        IdentityFile ~/.ssh/id_ed25519
      
    • Add your SSH private key to the ssh-agent and store your passphrase in the keychain.
      $ ssh-add --apple-use-keychain ~/.ssh/id_ed25519
  • Adding a new SSH key to your GitHub account
    • Copy the SSH public key to the clipboard:
      $ pbcopy < ~/.ssh/id_ed25519.pub
    • GitHub > Settings > SSH and GPG keys, click New SSH key or Add SSH key.
      • Title: Mac Studio
      • Key type: Authentication Key
      • Key: [paste your public key]
    • Test the SSH key:

5. Python Development Tools

5.1. Install uv

  • Install uv with standalone installers
    $ curl -LsSf https://astral.sh/uv/install.sh | sh
  • Restart your shell to check the current version of uv:
    $ uv -V
  • Upgrading uv
    $ uv self update
  • Shell autocompletion
    $ echo $SHELL
    $ echo 'eval "$(uv generate-shell-completion zsh)"' >> ~/.zshrc
    $ echo 'eval "$(uvx --generate-shell-completion zsh)"' >> ~/.zshrc
  • Restart shell for the changes to take effect:
    $ exec $SHELL
  • If the message command not found: compdef appear, add the following to the beginning of the ~/.zshrc file and restart the shell again:
    autoload -Uz compinit
    compinit

5.2. Install Python

5.3. Run JupyterLab

6. Java Development Tools

6.1. Install SDKMAN!

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

6.2. Install Java Development Kit (OpenJDK - Eclipse Temurin)

  • List the available version of Java:
    $ sdk list java
  • Install Eclipse Temurin™ 21 - LTS
    $ sdk install java
  • Check the current version of Java
    $ sdk current
    $ java -version
    
  • Switch to Java version in this shell.
    $ sdk use java 21.0.6-tem
  • Configure default Java version for all shells.
    $ sdk default java 21.0.6-tem
  • Locate where JDK is installed:
    $ readlink -f $(which java)

6.3. Install Apache Maven

  • Install Apache Maven:
    $ sdk install maven
  • Check the current version of Maven:
    $ sdk current
    $ mvn -v

7. React Development Tools

7.1. Install Node.js

  • Download Node.js
    # Download and install nvm:
    $ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash
    
    # in lieu of restarting the shell
    $ \. "$HOME/.nvm/nvm.sh"
    
    # Download and install Node.js:
    $ nvm install --lts
    
    # Verify the Node.js version:
    $ node -v
    $ nvm current
    
    # Download and install Yarn:
    $ corepack enable yarn
    
    # Verify Yarn version:
    $ yarn -v

About

macOS Development Environment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published