---
title: Macセットアップメモ (Apple M4 Max)
tags: []
categories: ["Dev", "OS", "MacOSX"]
date: 2024-11-13T14:03:19Z
updated: 2025-02-10T04:25:43Z
---

### Toolのインストール

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

echo >> ~/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
```

```
brew install neofetch
brew install fastfetch
```

<img width="710" alt="image" src="https://github.com/user-attachments/assets/9ebb404a-db44-43b4-bfba-cb4b25edbeec">


```
brew install --cask karabiner-elements
brew install --cask spectacle
brew install --cask google-chrome
```

```
brew install tree
brew install bat
brew install wget
brew install watch
brew install htop
brew install ffmpeg
brew install socat
brew install sshuttle
```

```
brew install awscli
brew install azure-cli
brew install google-cloud-sdk
brew install oci-cli
brew install flyctl
brew install ibm-cloud-cli
```

```
aws configure sso --profile default
```

```
brew install libpq
brew install duckdb
```

```
echo 'export PATH="/opt/homebrew/opt/libpq/bin:$PATH"' >> ~/.zshrc
echo 'export LDFLAGS="-L/opt/homebrew/opt/libpq/lib"' >> ~/.zshrc
echo 'export CPPFLAGS="-I/opt/homebrew/opt/libpq/include"' >> ~/.zshrc
source ~/.zshrc
```


```
brew install orbstack
brew install kubernetes-cli@1.30
echo 'source <(kubectl completion zsh)' >> ~/.zshrc
echo 'export PATH="/opt/homebrew/opt/kubernetes-cli@1.30/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
brew tap carvel-dev/carvel
brew install ytt kbld kapp imgpkg vendir kctrl
brew install buildpacks/tap/pack
brew tap vmware-tanzu/tanzu
brew install tanzu-cli
brew install int128/kubelogin/kubelogin
brew install helm
brew install stern
brew install kind
```

```
curl -sL https://github.com/itaysk/kubectl-neat/releases/download/v2.0.4/kubectl-neat_darwin_arm64.tar.gz | tar xzvf - -C /tmp
sudo mv /tmp/kubectl-neat /usr/local/bin/ 
```

```
brew install cloudfoundry/tap/cf-cli@8
```

```
brew install qemu
brew install lima
brew install socket_vmnet
sudo cp -r /opt/homebrew/opt/socket_vmnet /opt/socket_vmnet
sudo chown -R root /opt/socket_vmnet/bin
limactl sudoers | sudo tee /etc/sudoers.d/lima
```

<!--
socket_vmnet requires root privileges so you will need to run
  `sudo /opt/homebrew/opt/socket_vmnet/socket_vmnet` or `sudo brew services start socket_vmnet`.
You should be certain that you trust any software you grant root privileges.

socket_vmnet is keg-only, which means it was not symlinked into /opt/homebrew,
because Homebrew's bin directory is often writable by a non-admin user.

If you need to have socket_vmnet first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/socket_vmnet/bin:$PATH"' >> ~/.zshrc

To start socket_vmnet now and restart at startup:
  sudo brew services start socket_vmnet
Or, if you don't want/need a background service you can just run:
  /opt/homebrew/opt/socket_vmnet/bin/socket_vmnet --vmnet-gateway\=192.168.105.1 /opt/homebrew/var/run/socket_vmnet
-->

```
brew install --cask intellij-idea
brew install --cask zed
```

```
curl -s "https://get.sdkman.io" | bash
source  ~/.sdkman/bin/sdkman-init.sh
```

```
sdk install java 21.0.5-graal
sdk install java 17.0.12-graal
sdk install java 8.0.432-librca
sdk default java 21.0.5-graal
```

```
brew install maven ant
brew install tomcat
```

```
brew install node@22
echo 'export PATH="/opt/homebrew/opt/node@22/bin:$PATH"' >> ~/.zshrc
```

```
brew tap hashicorp/tap
brew install hashicorp/tap/vault
```

```
brew install sops
brew install age
```

```
brew install llama.cpp
brew install ollama
```

```
brew install --cask vmware-fusion
```

```
brew install --cask slack
brew install --cask zoom
```


### gitの設定

```
git config --global user.email "makingx@gmail.com"
git config --global user.name "Toshiaki Maki"
```

### zshの設定

```
echo "alias ll='ls -laGh'" >> ~/.zshrc
cat <<'EOF' >> ~/.zshrc
precmd () {
  psvar=()
  psvar[1]=$(kubectl config current-context)
}
export PROMPT='(%~)[%1v] $ '
EOF
source ~/.zshrc
```

### IntelliJ IDEAの設定

* Settings -> General -> Appearance -> check "Show whitespaces"
* Settings -> Editor -> Code Style -> YAML -> Uncheck "Indent sequence value"

### Karabiner-Elementsの設定

<img width="827" alt="image" src="https://github.com/user-attachments/assets/43506118-5a77-48da-b5b0-4524989b0969">

<img width="827" alt="image" src="https://github.com/user-attachments/assets/2ed1f72d-593f-43e9-87b6-2767293f777b">

<img width="827" alt="image" src="https://github.com/user-attachments/assets/ce62fe85-6a4b-4cf1-b9ca-d95215163e6f">

<img width="1024" alt="image" src="https://github.com/user-attachments/assets/bbfe1bdd-f545-47f5-8d9f-cce957d0bc68">

<img width="1024" alt="image" src="https://github.com/user-attachments/assets/c2361b7b-8b66-46e9-b05e-22e86bff2d81">

<img width="1024" alt="image" src="https://github.com/user-attachments/assets/f9b97f06-a63c-4165-95f8-a98bb4e34bae">

<img width="1024" alt="image" src="https://github.com/user-attachments/assets/41e562fb-5a94-4aef-b595-dacb50db61ac">

<img width="1024" alt="image" src="https://github.com/user-attachments/assets/71c799c3-8f01-4656-acdd-11520a4655d9">

<img width="1024" alt="image" src="https://github.com/user-attachments/assets/e66f20b3-e839-420c-aef2-9c7ad062c740">

<img width="1024" alt="image" src="https://github.com/user-attachments/assets/8bfdf9e6-0065-4489-9763-8915663bdf8a">

### コントロールセンタ

<img width="827" alt="image" src="https://github.com/user-attachments/assets/1d374c6b-a892-4b2d-aaee-f8e5a0a786fa">

### キーボード

<img width="827" alt="image" src="https://github.com/user-attachments/assets/9fff16a1-039a-4e1e-8b36-d69f7f42d234">

「キーボードショートカット」→「入力ソース」

<img width="827" alt="image" src="https://github.com/user-attachments/assets/89f3b590-9273-40e3-934c-8bf95a54bfbe">

### トラックパッド

<img width="827" alt="image" src="https://github.com/user-attachments/assets/6b290b6b-ca51-40c8-9d9d-144aad766294">


### プライバシーとセキュリティ

<img width="827" alt="image" src="https://github.com/user-attachments/assets/2fb717b5-2440-45ed-934d-bc6c05a0a783">

<img width="827" alt="image" src="https://github.com/user-attachments/assets/995e2197-d0a6-4fa7-8f60-6b0242f8d484">

<img width="827" alt="image" src="https://github.com/user-attachments/assets/cc294942-dfaf-4a88-b15a-6b520fa2afab">

### ログイン時に開くアプリ

<img width="827" alt="image" src="https://github.com/user-attachments/assets/ad3c663f-393d-4f93-8a01-45e4bc2849f0">

### IntelliJ IDEA

```
mkdir -p ~/idea/plugins
wget https://repo1.maven.org/maven2/io/spring/javaformat/spring-javaformat-intellij-idea-plugin/0.0.43/spring-javaformat-intellij-idea-plugin-0.0.43.jar -P ~/idea/plugins
```

* "Settings" -> "Plugins" -> "Install Plugin from Disk" -> `~/idea/plugins/spring-javaformat-intellij-idea-plugin-0.0.43.jar`
* "Settings" -> "Editor" -> "Code Style" -> "YAML" -> "Tabs and Indents" -> Uncheck "Indent sequence value"
