How to setup my Mac step by step?
Reference : macOS Setup Guide - Sourabh Bajaj
Related : macOS Efficiency Guide - 效率指南
This guide has been recently used by the author on 2021/12/02
- macOS Monterey version 12.0.1
- MacBook Pro 2021 with M1 Pro chip
Follow the principles :
-
KISS - Keep It Simple and Stupid / Short - 简单原则
Assume that you are an experienced Mac user and a software developer, so I can focus on the procedure and skip the unnecessary descriptions
e.g. the softwares' introductions, their usages and development knowledge
If some content belongs to another page, there's no need to show it, just give a reference link and tell the reader to return once finished
-
OOTB - Out Of The Box - 开箱即用
Try not to change the default settings
-
FYI only - For Your Information only - 仅供参考
SKIP this step if set up a new Mac or have already re-installed a new macOS
RECOMMEND to 避免直接将备份数据还原到新系统中
因为每次将过去 Mac 的备份数据直接还原到新系统中都难免会产生冗余、无用甚至错误的数据; 随着时间推移,我们不仅需要越来越大的存储空间来保存它们,而且可能会产生难以解决的问题。 所以,为了适时淘汰这些可能存在问题的数据,建议每次迁移 Mac 时都尽量避免直接迁移旧数据。
Follow the references : Apple Support
- 在 Mac 上抹掉所有内容和设置 - optional
- 如何创建可引导的 macOS 安装器
- 如何重新安装 macOS
First of all :
-
Connect to Internet via Wi-Fi or Erthernet
-
Login AppleID to synchronize the settings & iCloud data
- or register at first if without an AppleID
-
Open this guide on Mac so that I can continue the following steps
The password manager makes it easier and safer to login other accounts
e.g. using 1Password
-
Install via Mac App Store
-
Open and login the account on my.1password.com - recommended
- or load the vaults on iCloud
Note : List of password managers - Wikipedia
RECOMMEND to configure the network proxy for stable Internet connections in China mainland so that I can continue the following steps more smoothly
GUI - Graphical User Interface
-
Get the proxy service
Note : Because the valid methods to get a stable network proxy may change often, RECOMMEND to search the new methods on the Internet when needed
How to :
- A. BUY - recommended
- B. Build it myself
-
Get the proxy configurations from the proxy service
e.g. via subscription URL
List of configuration methods :
- A. subscription URL - recommended
- B. configuration file
- C. server URLs
- D. QR codes
- …
-
Install the proxy plugin
e.g. ClashX Pro
List of proxy plugins :
- A. Clash
- B. ClashX : releases
- C. ClashX Pro : releases - recommended
- D. Surge
- E. Trojan
- F.
TrojanX - G.
Trojan-Qt5 - H. Shadowsocks
- I.
ShadowsocksX - J.
ShadowsocksX-NG - …
-
Import the proxy configurations into the proxy plugin
e.g. configure ClashX Pro via the subscription URL :
- Open
ClashX Pro
- Menu Bar →
ClashX Pro
- →
Config
→Remote config
→Manage
→Add
→ Enter the subscription URL →OK
- →
Config
→ Select the new config I added - usually unnecessary - →
Set as system proxy
- →
Dashboard
→Setting
→ EnableStart at login
- →
- Open
-
Check the Internet connection
e.g. visit google.com/ncr on the browser
CLI - Command Line Interface
Configure the network proxy on CLI
-
Get the proxy from the proxy plugin
e.g. get it from ClashX Pro
Menu Bar →
ClashX Pro
→Copy shell command
:export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
-
Add the proxy on CLI
Note : Require that the ClashX Pro proxy is running and enabled
How to :
-
A. Temporarily : Add it in the Terminal tab temporarily - recommended for now
- Open
Terminal
→ Paste the shell command above to execute
- Open
-
B. All the time : Use ZSH with the network proxy
- Append the shell command above to the ZSH configuration file
~/.zshrc
- Append the shell command above to the ZSH configuration file
-
-
Check the Internet connection on CLI
e.g. visit google.com in Terminal tab opened above :
$ curl google.com # Success <HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8"> <TITLE>301 Moved</TITLE></HEAD><BODY> <H1>301 Moved</H1> The document has moved <A HREF="http://www.google.com/">here</A>. </BODY></HTML> # Failure curl: (56) Recv failure: Connection reset by peer
Homebrew is a software package management system that simplifies the installation of software on macOS
Homebrew-Cask extends Homebrew and allows me to install the large binary files via a command-line tool
I can search the available softwares I need on Homebrew Formulae
- CLI softwares : Formula - a listing of all packages available from the core tap
- GUI softwares : Cask - a listing of all casks available from the cask tap
-
Install
How to :
- A. Homebrew - brew.sh - official
- B. 国内如何自动安装 - 知乎 - recommended
-
Check
$ brew --version # e.g. Homebrew 3.3.6 Homebrew/homebrew-core (git revision 628aed8b9e1; last commit 2021-12-02) Homebrew/homebrew-cask (git revision 6c3d470278; last commit 2021-12-02)
-
Speed up
Reference : Homebrew (中国大陆) 有比较快的源 (mirror) 吗? - 知乎
-
Update & upgrade - in the future
brew update && brew upgrade
-
RECOMMEND to prevent Mac from automatically sleeping in a short time
so that the installations can be less likely to be interrupted by auto-sleeping
e.g. let the display wait for a long time before turning off
System Settings
→Battery
-
Battery
- Set
Turn display off after:
40 minutes - Disable
Put hard disks to sleep when possible
- optional
- Set
-
Power Adapter
- Set
Turn display off after:
40 minutes - Enable
Prevent your Mac from automatically sleeping when the display off
- optional
- Set
-
CLI - Command Line Interface
RECOMMEND to install CLI programs via Homebrew
e.g. for me
brew install \
coreutils \
git \
fzf \
gpg \
jq \
nvim \
php \
reattach-to-user-namespace \
safe-rm \
tmux \
vim \
wget
Note : The pre-installed softwares may be outdated e.g. git
,
so RECOMMEND to install them via Homebrew again
Note : Why I need these CLI softwares?
-
coreutils : The basic file, shell and text manipulation utilities of the GNU operating system
It include many useful commands, see TOC of GNU Coreutils
e.g. get the absolute path to a file or directory via
realpath
command -
tmux
requiresreattach-to-user-namespace
to write and read the system clipboardreattach-to-user-namespace
reattaches to the per-user bootstrap namespace in its "background" session and then execute the program with arguments -
…
GUI - Graphical User Interface
RECOMMEND to install the GUI softwares via Homebrew-Cask
RECOMMEND to execute the following commands in parallel in multiple Terminal tabs
NOTICE : The installations may REQUIRE me to enter Mac PASSWORD, e.g. karabiner-elements
e.g. for me
-
First
brew install --cask \ google-chrome \ karabiner-elements \ keyboard-maestro \ wechat
-
Auxiliary
brew install --cask \ appcleaner \ bartender \ imageoptim \ itsycal \ kindle \ monitorcontrol \ numi \ qq \ snipaste \ ticktick
-
Development
brew install --cask \ iterm2 \ jetbrains-toolbox \ visual-studio-code
-
Entertainment
brew install --cask \ iina \ neteasemusic \ parallels \ qqmusic \ steam \ thunder
-
Office
brew install --cask \ linear-linear \ notion \ slack
Install the GUI softwares via Mac App Store
Note : The GUI softwares unavailable on Homebrew-Cask may be available on Mac App Store
- 1Password - done before
- Copy 'Em
- EasyRes
- EuDic 欧路词典 - 相对于 "增强版" 而言, 属于 "免费版"
Install the GUI softwares via the installations downloaded from the websites
Note : Some GUI softwares are only available on the websites
Note : brew install --cask sublime-text
will install the latest version, but I still stick on version 3,
because I have already bought Sublime Text 3 and it still meets my requirements - a lightweight editor for fast editing
GitLab keys ditto
Using the SSH protocol, I can connect and authenticate to remote servers and services
- With SSH keys, I can connect to GitHub without supplying my username and personal access token at each visit
How to :
-
Generate a SSH key pair
Reference : Generating a new SSH key and adding it to the ssh-agent - GitHub
-
Get the SSH public key and add it to the GitHub account
Reference : Adding a new SSH key to your GitHub account - GitHub
Use GPG to sign tags and commits locally
- These tags or commits are marked as verified on GitHub so other people can be confident that the changes come from a trusted source
SKIP this step if don't need to sign the git commits
Note : I just need to do it for work in the open source projects
RECOMMEND NOT to sign the git commits in the private projects, because there are few benefits
How to :
-
Generate a GPG key pair
Reference : Generating a new GPG key - GitHub
-
Get the GPG pulic key
Reference : GPG Command Guide - icehe.life
-
Add the GPG key to the GitHub account
Reference : Adding a new GPG key to your GitHub account - GitHub
-
Problem :
gpg failed to sign the data
$ git commit -m "troubleshooting" error: gpg failed to sign the data fatal: failed to write commit object
Solution : Append the following shell command to the ZSH configuration file
~/.zshrc
export GPG_TTY=$(tty)
Reference : gpg failed to sign the data fatal: failed to write commit object
- The second answer is better.
e.g. load my personal dotfiles from GitHub into the local user home directory
cd ~
git init
git remote add origin [email protected]:IceHe/mac-conf.git
git pull origin master
git branch --set-upstream-to=origin/master master
e.g. for me
-
Synchronize the most of the settings via the global configuration files
e.g. from the dotfiles downloaded above
~/.gitconfig.sample
~/.gitignore
~/.gitignore_global
- …
-
Initilize the global configuration file
~/.gitconfig
e.g. according to the sample file
~/.gitconfig.sample
from the dotfiles downloaded abovecp .gitconfig .gitconfig.sample
-
Configure the global user name & email
Note :
~/.gitconfig.sample
have already conatained the following two same configuration items by defaultgit config --global user.name icehe.life git config --global user.email [email protected]
-
Configure GPG-sign - optional
SKIP this step if don't need to sign the git commits
-
Enable GPG-sign
git config --global commit.gpgsign true
-
Configure the signing key from the GitHub GPG key generated above
SKIP configuring the user signing key if there is only one GPG key, because git will use the unique GPG key by default
git config --global user.signingkey [SIGNING_KEY]
-
-
Check the global settings
e.g. for me
$ git config --global -l commit.gpgsign=true filter.lfs.required=true filter.lfs.clean=git-lfs clean -- %f filter.lfs.process=git-lfs filter-process filter.lfs.smudge=git-lfs smudge -- %f gpg.program=gpg http.sslverify=false pager.branch=false pull.rebase=true user.name=icehe.life [email protected] user.signingkey=[SIGNING_KEY] …
-
Install
Reference : Install oh-my-zsh now - ohmyz.sh
-
Synchronize the ZSH settings via the configuration file
~/.zshrc
e.g. from the dotfiles downloaded above
-
Install the ZSH plugin
zsh-autosuggestion
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
Reference : Installation - zsh-users/zsh-autosuggestions
SKIP this step if don't need to write or view PlantUML diagrams
PlantUML requires GraphViz to write UML diagrams
brew install libtool
brew link libtool
brew install graphviz
brew link --overwrite graphviz
Note : The commands above fix the issues if installed GraphViz via the .dmg
package
I can specify the environment variable GRAPHVIZ_DOT
to set the exact location of the GraphViz executable.
By default, the dot executable is expected :
- Firstly in :
/usr/local/bin/dot
- Then in :
/usr/bin/dot
GUI - Graphical User Interface
Open System Settings
at first
Note : Revert the settings changed above back to the default values
-
Battery
- Set
Turn display off after:
3 min - Enable
Put hard disks to sleep when possible
- Set
-
Power Adapter
- Set
Turn display off after:
10 min - Disable
Prevent your Mac from automatically sleeping when the display off
- Set
For all the softwares appeared on the Dock at the bottom of the desktop
- Right click the software icon →
Options
→ DisableKeep in Dock
Dock & Menu Bar
- Enable
Automatically hide and show the Dock
- Disable
Show recent applications in Dock
Note : Menu Bar DOES NOT have enough space for many software icons so I have to hide some of them
Some of the icons can still be visible in Control Center
Wi-Fi
- Disable
Show in the Menu Bar
Bluetooth
- Disable
Show in the Menu Bar
Screnn Mirroring
- Disable
Show in the Menu Bar
Display
- Disable
Show in the Menu Bar
Sound
- Enable
Show in the Menu Bar
→ Selectalways
Spotlight
- Disable
Show in the Menu Bar
Siri
- Disable
Show in the Menu Bar
Keyboard
- Enable
Use F1, F2, etc. keys as standard function keys
Text
- Clear all
Replace With
- Clear all checkboxes
Shortcuts
-
Add
App Shortcuts
Google Chrome
→Duplicate Tab
→⇧ ⌘ D
iTerm
→Toggle Full Screen
→^ ⌘ F
-
Clear the unused shortcuts
Input Sources
-
Add the input source
Shuangpin - Simplified
- Shuangpin layout :
Xiaohe
- Enable
Show predictive completions
- Enable
Use halfwidth punctuation
- Shuangpin layout :
-
Clear the unused input sources
How to disable Character Accents Popup
and enable Key Repeat
:
-
Enable
Key Repeat
and then Rebootdefaults write -g ApplePressAndHoldEnabled -bool false
Reference : Search "macos keyboard cannot repeat" on Google
Hot Corners…
→ The bottom right corner → ReplaceQuick Note
with-
- Disable the unncessary softwares' notifications on demand
- Edit
Computer Name:
e.g. macbook-pro-ice
-
Login the Google account
-
Turn on
Sync
- automaticallyChrome will usually request me to turn on
Sync
after loginMAY require the independent synchronization password
-
Synchronize the extensions - automatically
Chrome will do it in the background after I turning on
Sync
I can do it manually if
Sync
does not work wellChrome
Menu Bar →Window
→Extensions
→ Sidebar on the left →Open Chrome Web Store
- 1Password : password manager
- Proxy SwitchyOmega : manage and switch between multiple proxies quickly & easily
- Chrono Download : download and manage the web
- OneTab : reduce tab clutter If open too many tabs, stash them in OneTab
- uBlock Origin : a lightweight AD blocker
- Vimium : provide keyboard shortcuts for navigation and control in the spirit of Vim
- JSON Formatter : make JSON easy to read
-
Synchronize the extension
Proxy SwitchyOmega
settings - manuallye.g. via the configuration file from another Mac
-
Synchronize the extensions' keyboard shortcuts - automatically
I can do it manually if
Sync
does not work well-
Menu Bar →
Window
→Extensions
→ Sidebar on the left →Keyboard shortcuts
- 1Password
⇧ ⌘ X
Activate the extension
- Chrono Download Manager
⇧ ⌘ J
Activate the extension
- OneTab
⇧ ⌘ O
Activate the extension⇧ ⌘ S
DiSplay / Show OneTab⇧ ⌘ C
Send the Current tab to OneTab
- Clear the unused shortcuts
- 1Password
-
-
Synchronize the settings - automatically
via the configuration file
~/.config/karabiner/karabiner.json
e.g. from the dotfiles downloaded above
-
Enter the license
-
Keyboard Maestro
→Register Keyboard Maestro…
-
Enter
Email
andLicense key
-
-
Synchronize the macros
-
File
→Start Syncing Macros…
→Open Existing…
-
Choose the configuration file
~/.config/Keyboard Maestro Macros.kmsync
e.g. from the dotfiles downloaded above
-
-
Preferences
→General
→ EnableLaunch Engine at Login
-
Synchronize the settings via the built-in feature Settings Sync
- Sign in via GitHub
-
Synchronize the extensions - automatically
I can do it manually if
Settings Sync
does not work well- markdownlint : check Markdown style
- Markdown Preview Enhanced : support PlatUML real-time rendering in the Markdown code blocks
- PlantUML :
support PlatUML real-time rendering in the files
\*.puml
- Vim : the emulator for editing text like Vim
- …
-
Configure
-
Press the shortcut
⌘ ,
to openPreferences.sublime-settings
of the User -
Edit the content as below :
{ "ignored_packages": [], "tab_size": 4, "translate_tabs_to_spaces": true, "update_check": false, "vintage_use_clipboard": true }
-
-
Install
Package Control
- Press the shortcut
⇧ ⌘ P
- Search
install
- Select
Install Package Control
to install
- Press the shortcut
-
Install the package
Pretty JSON
- Press the shortcut
⇧ ⌘ P
- Search
install
- Select
Package Control: Install Package
- Search
Pretty JSON
- Select
Pretty JSON
to install
- Press the shortcut
-
Enter the license - optional
Help
→Enter License
- Enter the license key
-
Synchronize the settings
Preferences
→General
→Preferences
- Enable
Load preference from a custom folder or URL
- Select the config folder from the dotfiles downloaded above
- Select : Save changes
When Quitting
-
Enable the access to the system clipboard
I can Do it manually if the synchronization does not work well
Preferences
→General
→Selection
- Enable
Applications in terminal may access clipboard
-
Select the color theme
Preferences
→Profiles
→Colors
→Color Presets
- Select any color preset I like
-
Sort Order
at the top right corner of the popup menu- Select
Most Recently Used
or press⌥ ⌘ R
- Select
-
Preferences
at the bottom left corner of the popup menu-
Enable
Launch at Login
-
Window Appearance
- Select
Midday
- Set
Minimum Font Size
15 - Select
Auto-Scroll to Last Selected After List Change
- Select
-
Window Position
→Open at Active Screen
-
Search Field
- Enable
Toggle Search Filters with ⌘ F
- Eanble
Search Immediately After Each Keystroke
- Enable
-
Keyboard Shortcuts…
-
Global Shortcuts
- Set
Open window
to⌥ V
- Set
Paste current clipboard item as plain test
to⇧ ⌘ V
- Set
-
Local Shortcuts
- Set
Switch to 'All' list
to⇧ ⌘ A
- Set
-
Clear the unused shortcuts
-
-
Enbale
Get Titles of Web URLs
-
Enable
Reject Duplicates
-
Auto-Delete Unstarred Items
→Auto-Delete Oldest…
- Store only the most recent
1000
unstarred items…
- Store only the most recent
-
Preferences…
-
General
- Enable
Run on system startup
- Enable
-
Control
→Global Hotkeys
- Set
Snip
to^ ⌘ A
- Clear the unused hotkeys
- Set
Preferences…
-
General
- Startup :
- Enable
Launch Bartender at login
- Enable
- Activations :
- Enable
Clicking on the menu bar will show/hide menu bar items
- Enable
Moving the mouse into the menu bar will show hidden menu bar items
- Enable
- Bartender Bar :
- Enable
Use Bartender Bar to show hidden items
- Enable
- Menu bar item spacing :
- Select
Small Spacing - previous macOS spacing
- Select
- Startup :
-
Menu Bar Layout
- Change on demand
-
License
- Enter the License
Preferences…
-
General
- Enable
Launch at login
- First day of week:
Monday
- Enable the calendars on demand
- Enable
-
Appearance
-
Menu Bar
- Datetime pattern :
E, dd MMM HH:mm:ss
- Enable
Hide icon
- Datetime pattern :
-
Calendar
Highlight
- Enable
Saturday
andSunday
- Enable
- Enable
Show event dots
- Enable
Use colored dots
- Enable
- Enable
Use event location
- Enable
Use calendar weeks
-
System Preferences
Dock & Menu Bar
→Clock
→ Time Options :Analog
偏好设置
-
同步
登录…
→ Login via QQ account
-
通用
词典
- Enable
自动展开在线词典内容
- Enable
查词后自动加入生词本
- …
- Enable
-
取词
- Clear the unused checkboxes
-
快捷键
- Clear the unused shortcuts
Git clone the projects to the local machine
e.g. clone github.com/IceHe/lib
mkdir ~/Projects
cd ~/Projects
git clone [email protected]:IceHe/lib.git
JDK - Java Development Kit
REQUIRED by Maven, Gradle, JetBrains IDEs and etc.
RECOMMEND to install the JDKs of the common used version 11 and the latest LTS version 17
LTS - Long-Term Support
-
A. via Homebrew - recommended
brew install openjdk@11 java --version brew install openjdk java --version
-
B. via SDKMAN!
-
Install SDKMAN!
Reference : Installation - SDKMAN!
-
Install JDK via SDKMAN!
Reference : JDKs - SDKMAN!
sdk install java [VERSION]
-
-
C. via the installation downloaded from the websites
Reference : Java Downloads - Oracle
Set the environment variable JAVA_HOME
- automatically
e.g. via the dotfiles downloaded above
I can do it manually : append the command below to the ZSH configuration file ~/.zshrc
:
export JAVA_HOME=`/usr/libexec/java_home -v 17`
- If use
bash
instead ofzsh
, append to the BASH configuration file~/.bashrc
Note : The tilde symbol ~
equals the path of the current user home directory, e.g. for me /Users/icehe
Note : Get the path to JDK via /usr/libexec/java_home
, e.g. JDK 8
$ /usr/libexec/java_home -v 1.8
/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home
RECOMMEND to use JetBrains tools
-
Install JetBrains Toolbox
brew install --cask jetbrains-toolbox
-
Login the JetBrains account on account.jetbrains.com/login
-
Open
JetBrains Toolbox
→ Menu Bar →JetBrains Toolbox
→Settings
→Log in
→Approve
→ Jump back toJetBrains Toolbox
Menu -
Install the required tools
e.g. for me
- IntelliJ IDEA Ultimate
- DataGrip
RECOMMEND to use the JetBrains IDE plugins
e.g. for me
Common
- IdeaVim : Vim emulator - edit text like Vim
- Indent Rainbow : Colorize the indentation in front of the text alternating four different colors on each step
- Key Promoter X : Learn essential shortcuts while I'm working
- PlantUML integration : Draw UML graphs for docs by PlantUML
- Rainbow Brackets : Code faster and smarter using code completions learned from millions of programs directly
- String Manipulation : Case switching, sorting, filtering, incrementing, aligning to columns, grepping, escaping, encoding…
- …
IntelliJ IDEA
- Lombok Plugin : Never write another getter or equals method again Project Lombok is a java library that automatically plugs into the editor and build tools, spicing up your java. Early access to future java features such as val, and much more.
- Maven Helper : A must have plugin for working with Maven
- google-java-format : Reformats Java source code to comply with Google Java Style
- generateAllSetter
- …
-
Install
-
A. via Jetbrains Toolbox - recommended
-
B. via the installation downloaded from the official website
Note : I can choose the Community verion to skip entering the license
-
-
Enter the license - optional
SKIP if install IntelliJ IDEA via JetBrains Toolbox - which has been logined the account with the related license
RECOMMEND to buy the commercial license or offer free educational licence for students and teachers
- Menu Bar →
Help
→Register…
→ Enter the license
- Menu Bar →
-
Configure the network proxy - optional
e.g. via ClashX Pro
Peferences
→Appearance & Behavior
→System Settings
→HTTP Proxy
→ SelectManual proxy configuration
→ SelectSOCKS
Host name:
Enter127.0.0.1
Port number:
Enter7890
Check connection
→ Enterhttp://google.com
→OK
- Prompt
Connection successful
if success
- Prompt
-
Synchronize the settings - optional
-
A. via IDE Settings Sync - recommended
Reference : Share settings through Settings Sync
-
B. via the settings repository
Note : It can synchronize the same settings accross multiple JetBrains's accounts, but the settings DO NOT include the plugins
Reference : Share settings through a settings repository
File
→Manage IDE Settings
→Settings Repository…
- Enter HTTPS URL to the settings GitHub repository
- Enter the GitHub personal access token from github.com/settings/tokens
- Select
Overwrite Local
at the first synchronization
-
C. via exporting and importing the configuration file
Reference : Export your settings
-
-
Install the plugins - optional - automatically
e.g. via IDE Settings Sync above
As metioned above : "JetBrains Toolbox - Plugins"
-
Set the font
Consolas
- optional - automaticallye.g. via IDE Settings Sync above
- Search on the Internet, download and install
Preferences
→Editor
→Color Scheme
→Color Scheme Font
→Font
-
Set the color scheme
Solarized Light (Alternate)
- optional - automaticallye.g. via IDE Settings Sync above
-
Download on the Internet :
-
Preferences
→Editor
→Color Scheme
→Scheme
→Import
→ Select the file downloaded above
-
-
Install Apache Maven -
mvn
brew install maven mvn -version
-
Create / Update the Maven configuration file
~/.m2/settting.xml
- optionale.g. according to the sample file
~/.m2/settings_demo.xml
open ~/.m2/settting.xml
Note :
open
file with the default editor
NOTICE : if use the private Mac and the Maven configuration file MAY exists, please merge the existing content with the new content carefully
RECOMMEND to use the Node.js of the main version 16
-
A. via Homebrew
e.g. for me
brew install node@16
-
B. via Node Version Manager - recommended
-
Install Node Version Manager -
nvm
$ brew install nvm # e.g. output ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/nvm-0.39.0.all.bottle.tar.gz Already downloaded: /Users/icehe/Library/Caches/Homebrew/downloads/4dc7eceb4921b8909c081af037518450c6e85151603a6f51695bf17bab3081f5--nvm-0.39.0.all.bottle.tar.gz ==> Reinstalling nvm ==> Pouring nvm-0.39.0.all.bottle.tar.gz ==> Caveats Please note that upstream has asked us to make explicit managing nvm via Homebrew is unsupported by them and you should check any problems against the standard nvm install method prior to reporting. You should create NVM's working directory if it doesn't exist: mkdir ~/.nvm Add the following to ~/.zshrc or your desired shell configuration file: export NVM_DIR="$HOME/.nvm" [ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && . "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm [ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && . "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion You can set $NVM_DIR to any location, but leaving it unchanged from /opt/homebrew/opt/nvm will destroy any nvm-installed Node installations upon upgrade/reinstall. Type `nvm help` for further information.
Reference : Installing and Updating - nvm
-
Configure the environment - automatically
Note : It has been done via the dotfiles downloaded above
I can do it manually again when there are any problems :
e.g. follow the PROMPT from the output of the command
brew install nvm
above-
Create NVM's working directory if it doesn't exist :
mkdir ~/.nvm
-
Append / Update the commands below to the ZSH configuration file
~/.zshrc
:export NVM_DIR="$HOME/.nvm" # Loads nvm [ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && . "/opt/homebrew/opt/nvm/nvm.sh" # Loads nvm bash_completion [ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && . "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm"
-
-
Install Node.js -
node
e.g. for me
nvm install node node --version nvm install 16 node use 16 node --version node alias default 16
Note : The latest main version is 17
Reference : Usage - nvm
-
Check the versions
e.g.
$ nvm --version 0.39.0 $ node --version v16.13.1
-
Upgrade - in the future
e.g. via installing again
nvm install node nvm install 16
-
Install or upgrade via installing again
npm install -g pnpm
Refer to IntelliJ IDEA above
Troubleshooting - References :
e.g. via Homebrew
brew install \
gradle \
kotlin
Refer to IntelliJ IDEA above
The following parts are different from IntelliJ IDEA :
-
Synchronize the settings - optional
-
A.
via IDE Settings Sync- NOT SUPPORTED by Android Studio! -
B. via the settings repository - recommended
-
C. via exporting and importing the configuration file
-
-
Install the plugins - manually
As metioned above : "JetBrains Toolbox - Plugins"
Troubleshooting - References :