[TOC]

概述

注意:如果系统安装了Iterm2命令行工具,则默认使用的是zsh. 这个时候需要:

1
vim ~/.zshrc

在文件的最后一行,添加:

1
source ~/.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
(base) frewen@FreweniMacBook 3.18.1 % cat ~/.bash_profile

# >>> 快捷指令别名定义 >>>
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias c='clear'
alias b='cd ..'
alias bhome="cd ~"
alias gst="git status"
alias rmf="rm -rf"
# <<< 快捷指令别名定义 <<<

# >>> 程序启动别名定义 >>>
alias chrome='/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome'
# <<< 程序启动别名定义 <<<

# >>> ADB环境变量 >>>
export ANDROID_HOME=/Users/frewen/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
# <<< ADB环境变量 <<<

# >>> NDK 环境变量 >>>
# export NDK_HOME=/Users/frewen/Library/Android/android-ndk-r10e
# export NDK_HOME=/Users/frewen/Library/Android/sdk/ndk/android-ndk-r21e
export NDK_HOME=/Users/frewen/Library/Android/sdk/ndk/21.3.6528147
export ANDROID_NDK_HOME=$NDK_HOME
export PATH=$PATH:$NDK_HOME
export PATH=$PATH:$ANDROID_NDK_HOME
# <<< NDK 环境变量 <<<

# >>> Cmake 环境变量 >>>
# export PATH="/Users/frewen/Library/Android/sdk/cmake/3.18.1/bin":"$PATH"
export PATH="/Applications/CMake.app/Contents/bin":"$PATH"
# <<< Camke 环境变量 <<<

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/frewen/Library/AFrewenLib/Anaconda/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/Users/frewen/Library/AFrewenLib/Anaconda/anaconda3/etc/profile.d/conda.sh" ]; then
. "/Users/frewen/Library/AFrewenLib/Anaconda/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/Users/frewen/Library/AFrewenLib/Anaconda/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<

export GRADLE_HOME=/Users/frewen/Library/Android/gradle/gradle-5.6.3
export PATH=${PATH}:${GRADLE_HOME}/bin

# NVM node 版本管理工具的环境变量
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion


#ADDED BY 010 EDITOR
export PATH="$PATH:/Applications/010 Editor.app/Contents/CmdLine"

# Flutter Image Address
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
# Flutter Version 1.7.8
export PATH=/Users/frewen/Library/flutter_macos_v1.7.8/bin:$PATH


# Repo Path Repo的环境变量地址
export PATH="$PATH:/Users/frewen/01.WorksSpace/AndroidSource/Android9.0"
export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'


# >>> Tomcat Home >>>
export PATH=$PATH:/Users/frewen/Library/AFrewenLib/apache-tomcat-10.0.20/bin
# <<< Tomcat Home <<<

# >>> Mysql Home >>>
export PATH=${PATH}:/usr/local/mysql/bin
# <<< Mysql Home <<<

# >>> VSCode Alias >>>
alias code='/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/code'
# >>> VSCode Alias >>>

# Java多版本切换的环境变量设置
export JAVA_8_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home"
export JAVA_11_HOME="/Library/Java/JavaVirtualMachines/jdk-11.0.5.jdk/Contents/Home"
export JAVA_HOME=$JAVA_8_HOME
alias jdk8='export JAVA_HOME=$JAVA_8_HOME'
alias jdk11='export JAVA_HOME=$JAVA_11_HOME'

# FFMpeg的环境变量
export PATH=$PATH:/usr/local/ffmpeg/bin

# Maven Home
export MAVEN_HOME=/Users/frewen/Library/apache-maven-3.6.3
export PATH=$MAVEN_HOME/bin:$PATH

# MySql Home
export PATH=${PATH}:/usr/local/mysql/bin

# MongoDB的环境变量
export PATH=${PATH}:/usr/local/mongodb-macos-x86_64-4.2.3/bin

# ANDROID_HOME的环境变量配置
export ANDROID_HOME=/Users/frewen/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools

# Gradle的环境变量
export GRADLE_HOME=/Users/frewen/Library/Android/gradle/gradle-6.2.2
export PATH=${PATH}:${GRADLE_HOME}/bin

# NDK_Home
export NDK_HOME=/Users/frewen/Library/Android/sdk/ndk/21.4.7075529
export ANDROID_NDK_HOME=/Users/frewen/Library/Android/sdk/ndk/21.4.7075529
export PATH=$PATH:$NDK_HOME
export PATH=$PATH:$ANDROID_NDK_HOME

# NVM 环境变量配置
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

# MongoDB的环境变量
export PATH=${PATH}:/usr/local/mongodb-4.2.3/bin

# Futter_HOME
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export FLUTTER_HOME=/Users/frewen/Library/AFrewenLib/flutter_V2.0.6
export PATH=${PATH}:${FLUTTER_HOME}/bin


export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'

# Tomcat的环境变量
export PATH=$PATH:/Users/frewen/Library/AFrewenLib/apache-tomcat-9.0.39/bin

# MySql的环境变量
export PATH=$PATH:/usr/local/mysql/bin

export PATH="/Applications/CMake.app/Contents/bin":"$PATH"

# OpenCV4.5.3的环境变量
export DYLB_LIBRARY_OPENCV_PATH=/Users/frewen/Library/AFrewenLib/opencv4.5.3/lib:$DYLB_LIBRARY_OPENCV_PATH
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/:$PKG_CONFIG_PATH
___MY_VMOPTIONS_SHELL_FILE="${HOME}/.jetbrains.vmoptions.sh"; if [ -f "${___MY_VMOPTIONS_SHELL_FILE}" ]; then . "${___MY_VMOPTIONS_SHELL_FILE}"; fi