苹果系统初始化 2025-12-07T00:57:41.597Z 2025-12-13T01:48:09.611Z 1.1k 5 分钟 China
允许任何来源
1 sudo spctl --master-disable
修改启动台行数列数
1 2 3 4 5 6 7 8 9 10 11 12 修改列数 1. 定义列数: defaults write com.apple.dock springboard-columns -int 8 2. 定义行数: defaults write com.apple.dock springboard-rows -int 6 3. 重置启动台: defaults write com.apple.dock ResetLaunchPad -bool TRUE 4. 重启启动台: killall Dock 恢复默认值 1. 恢复默认列数:defaults write com.apple.dock springboard-columns Default 2. 恢复默认行数:defaults write com.apple.dock springboard-rows Default 3. 重置启动台: defaults write com.apple.dock ResetLaunchPad -bool TRUE 4. 重启启动台:killall Dock
安装brew
从国内的基站下载安装
1 /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh) "
测试下安装的brew工具
1 2 3 4 5 6 7 8 brew upgrade; brew install telnet brew install wget
安装Iterm2
1 brew install --cask iterm2;
将iTerm2设置为默认终端
左上角菜单栏依次点击:iTerm2 -> Make iTerm Default Term
.无窗口时关闭程序
iTerm2 ->Preferences ->General ->Closing ->勾选Quit when all windows are closed
将zsh设置为默认Shell
1 2 3 4 echo $SHELL chsh -s /bin/zsh
将标签栏风格改为沉浸式
Term2 ->Preferences ->Appearance ->Theme ->选择Minimal
更多参看
https://blog.csdn.net/m0_56123985/article/details/118544483
安装oh-my-zsh
官网地址:oh-my-zshhttps://ohmyz.sh/#install
1 sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh) "
常用的一些插件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 brew install thefuck brew install zsh-autosuggestions brew install zsh-syntax-highlighting brew install autojump plugins=( git thefuck zsh-autosuggestions zsh-syntax-highlighting autojump ) source .zshrc[oh-my-zsh] plugin 'zsh-autosuggestions' not found [oh-my-zsh] plugin 'zsh-syntax-highlighting' not found git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
安装JDK多版本切换
下载各版本JDK https://adoptium.net/zh-CN ,并依次安装jdk
修改 .bash_profile文件,如果没有则创建一个新的bash_profile文件,这个文件主要配置开发环境相关的内容
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 JAVA_8_HOME=/Library/Java/JavaVirtualMachines/temurin-8.jdk/Contents/Home/ alias java8="export JAVA_HOME=$JAVA_8_HOME && echo '已切换至JDK8'" JAVA_11_HOME=/Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home/ alias java11="export JAVA_HOME=$JAVA_11_HOME && echo '已切换至JDK11'" JAVA_17_HOME=/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/ alias java17="export JAVA_HOME=$JAVA_17_HOME && echo '已切换至JDK17'" JAVA_21_HOME=/Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home/ alias java21="export JAVA_HOME=$JAVA_21_HOME && echo '已切换至JDK21'" export JAVA_HOME=$JAVA_17_HOME CLASSPATH=.:$JAVA_HOME /lib PATH=$JAVA_HOME /bin:$PATH export CLASSPATHexport PATH
1 2 3 4 5 6 7 8 vim ~/.zshrc source ~/.bash_profilesource ~/.zshrc
安装MAVEN环境
添加内容到 .bash_profile 中
1 2 3 4 export MAVEN_HOME=/Users/edwin/develop/env/maven/apache-maven-3.9.1export PATH=$MAVEN_HOME /bin:$PATH :.
安装NVM
安装命令
修改 ~/.bash_profile
1 2 3 4 5 export NVM_DIR=~/.nvmsource $(brew --prefix nvm)/nvm.shexport NVM_NODEJS_ORG_MIRROR=http://npm.taobao.org/mirrors/node
添加代理
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 function proxy_on () { export http_proxy="http://127.0.0.1:7890" export https_proxy="http://127.0.0.1:7890" export all_proxy="socks5://127.0.0.1:7890" echo -e "已开启代理" } function proxy_off (){ unset http_proxy unset https_proxy unset all_proxy echo -e "已关闭代理" } alias ip="curl ipinfo.io"
终端输入一下命令:
1 2 3 4 5 6 7 8 proxy_on proxy_off ip
AI相关
1 2 3 4 5 6 alias claude="claude --dangerously-skip-permissions" alias codex='codex -m gpt-5.1-codex-max -c model_reasoning_effort="high" -c model_reasoning_summary_format=experimental --search --dangerously-bypass-approvals-and-sandbox'
公司内部切换脚本
1 2 alias nw="/Users/edwin/develop/script/bin/change_wifi.sh"