zsh から bash に切り替え
bashに切り替える場合
% chsh -s /bin/bash
zshへ切り替える場合
$ chsh -s /bin/zsh
※切り替えた際は、ターミナルを再起動
llコマンドを使えるようにする
↓こちらの記事のとおり設定
mac ターミナル で llコマンドを 実行 できるようにする
Homebrewインストール
brewインストール前にXcodeをインストールし、Xcodeを1回起動してAgreeをする必要がある。
↓それをしてないとbrewインストール時に怒られる
You have not agreed to the Xcode license.
Before running the installer again please agree to the license by opening
Xcode.app or running:
sudo xcodebuild -license
brew のサイトにインストールコマンドがあるのでコピーして、ターミナルで実行する。
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
M1 Macだと、実行結果の最後の方に「Next steps」なるものが表示されるので、ここをコピペして実行する。
==> Next steps:
- Run these two commands in your terminal to add Homebrew to your PATH:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/ユーザー名/.bash_profile
eval "$(/opt/homebrew/bin/brew shellenv)"
下記を実行し、ターミナル再起動するとbrewが使えるようになっている。
$echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/ユーザー名/.bash_profile
バージョン確認してbrewが使えること確認
$ brew -v
Homebrew 3.4.5
Homebrew/homebrew-core (git revision 81874c83da6; last commit 2022-04-06)
.NET SDKをインストール
$brew install --cask dotnet-sdk
Mono をインストール
こちらから最新をダウンロードしてインストール。
(この時は「Download Mono 6.12.0(Visual Studio channel*)」)
VSCodeの設定を変更
メニュー > Code > 基本設定 > 設定 で下記を設定する
設定項目 | 設定値 |
---|---|
omnisharp.useGlobalMono | always |
omnisharp.monoPath | /Library/Frameworks/Mono.framework/Versions/Current |
ここまで設定してVSCodeでエラーが出ずに使用できるようになった。