.zshrc配置最佳實戰
阿新 • • 發佈:2019-02-19
情景:當時android環境打包一直報奇怪的錯,看不出來是環境變數的問題,最終修改環境變數為上述,則成功打包了.# If you come from bash you might have to change your $PATH. # export PATH=$HOME/bin:/usr/local/bin:$PATH # Path to your oh-my-zsh installation. export ZSH=$HOME/.oh-my-zsh # Set name of the theme to load. Optionally, if you set this to "random" # it'll load a random theme each time that oh-my-zsh is loaded. # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes ZSH_THEME="robbyrussell" # Uncomment the following line to use case-sensitive completion. # CASE_SENSITIVE="true" # Uncomment the following line to use hyphen-insensitive completion. Case # sensitive completion must be off. _ and - will be interchangeable. # HYPHEN_INSENSITIVE="true" # Uncomment the following line to disable bi-weekly auto-update checks. # DISABLE_AUTO_UPDATE="true" # Uncomment the following line to change how often to auto-update (in days). # export UPDATE_ZSH_DAYS=13 # Uncomment the following line to disable colors in ls. # DISABLE_LS_COLORS="true" # Uncomment the following line to disable auto-setting terminal title. # DISABLE_AUTO_TITLE="true" # Uncomment the following line to enable command auto-correction. # ENABLE_CORRECTION="true" # Uncomment the following line to display red dots whilst waiting for completion. # COMPLETION_WAITING_DOTS="true" # Uncomment the following line if you want to disable marking untracked files # under VCS as dirty. This makes repository status check for large repositories # much, much faster. # DISABLE_UNTRACKED_FILES_DIRTY="true" # Uncomment the following line if you want to change the command execution time # stamp shown in the history command output. # The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" # HIST_STAMPS="mm/dd/yyyy" # Would you like to use another custom folder than $ZSH/custom? # ZSH_CUSTOM=/path/to/new-custom-folder # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. plugins=(git) source $ZSH/oh-my-zsh.sh # User configuration # export MANPATH="/usr/local/man:$MANPATH" # You may need to manually set your language environment # export LANG=en_US.UTF-8 # Preferred editor for local and remote sessions # if [[ -n $SSH_CONNECTION ]]; then # export EDITOR='vim' # else # export EDITOR='mvim' # fi # Compilation flags # export ARCHFLAGS="-arch x86_64" # ssh # export SSH_KEY_PATH="~/.ssh/rsa_id" # Set personal aliases, overriding those provided by oh-my-zsh libs, # plugins, and themes. Aliases can be placed here, though oh-my-zsh # users are encouraged to define aliases within the ZSH_CUSTOM folder. # For a full list of active aliases, run `alias`. # # Example aliases # alias zshconfig="mate ~/.zshrc" # alias ohmyzsh="mate ~/.oh-my-zsh" # Add environment variable COCOS_CONSOLE_ROOT for cocos2d-x export COCOS_CONSOLE_ROOT=/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/tools/cocos2d-console/bin export PATH=$COCOS_CONSOLE_ROOT:$PATH # Add environment variable COCOS_X_ROOT for cocos2d-x export COCOS_X_ROOT=/Applications/Cocos/Cocos2d-x export PATH=$COCOS_X_ROOT:$PATH # Add environment variable COCOS_TEMPLATES_ROOT for cocos2d-x export COCOS_TEMPLATES_ROOT=/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/templates export PATH=$COCOS_TEMPLATES_ROOT:$PATH # Add environment variable NDK_ROOT for cocos2d-x export NDK_ROOT=~/Documents/android-ndk-r10d/ export PATH=$NDK_ROOT:$PATH # Add environment variable ANDROID_SDK_ROOT for cocos2d-x export ANDROID_SDK_ROOT=~/Documents/android-sdk-macosx/ export PATH=$ANDROID_SDK_ROOT:$PATH export PATH=$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH # Add environment variable ANT_ROOT for cocos2d-x export ANT_ROOT=/Applications/Cocos/tools/ant/bin/ export PATH=$ANT_ROOT:$PATH #sublimetext alias subl="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
android打包打不出來然後改了環境變數能用的那個版本
-----20180516-----
這個是目前使用的版本配置,可供參考:
alias adb="/Users/lewangame/Documents/adt-bundle-mac-x86_64-20140624/sdk/platform-tools/adb" # 自己用setup.py安裝的 # Add environment variable COCOS_CONSOLE_ROOT for cocos2d-x export COCOS_CONSOLE_ROOT=/Users/lewangame/Documents/cocos2d-x-3.11.1/tools/cocos2d-console/bin export PATH=$COCOS_CONSOLE_ROOT:$PATH # Add environment variable COCOS_X_ROOT for cocos2d-x export COCOS_X_ROOT=/Users/lewangame/Documents export PATH=$COCOS_X_ROOT:$PATH # Add environment variable COCOS_TEMPLATES_ROOT for cocos2d-x export COCOS_TEMPLATES_ROOT=/Users/lewangame/Documents/cocos2d-x-3.11.1/templates export PATH=$COCOS_TEMPLATES_ROOT:$PATH export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 # git alias(別名) alias gsfl="git submodule foreach --recursive git pull" alias gsfs="git submodule foreach --recursive git status" alias gsfr="git submodule foreach --recursive" alias gsfb="git submodule foreach --recursive git branch" alias ra="git stash -u && git stash clear" alias gsfrra="git submodule foreach --recursive git stash -u && git stash clear" alias gsfrus="git submodule foreach --recursive git submodule update --init --recursive" alias gg="git log --graph --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative" # Sublime Text alias subl="/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl" # GUANGXI_WORK_DIR=~/Documents/MJWork/gxmj/ccclient/js alias gxmj="cd $GUANGXI_WORK_DIR && subl . && date" #-----------------GXMJ project help command-------------- #alias cc="$GXMJ_MAC_RUNNABLE -workdir ~/Documents/GXMJWork/guangxi/mahjong -console disable" #-debugger codeide #編譯js為jsc alias c="python ~/Documents/MJWork/gxmj/newGXClient_3_11_1/fast_compile_js2jsc.py" # -workdir ~/Documents/MJWork/gxmj/newGXClient_3_11_1 -console disable #app1 GXMJ_MAC_RUNNABLE1=~/Documents/MJWork/exec_app/newGXClient_3_11_1-desktop_1.app/Contents/MacOS/newGXClient_3_11_1-desktop_1 alias cc1="c && $GXMJ_MAC_RUNNABLE1" #-debugger codeide #app2 GXMJ_MAC_RUNNABLE2=~/Documents/MJWork/exec_app/newGXClient_3_11_1-desktop_2.app/Contents/MacOS/newGXClient_3_11_1-desktop_2 alias cc2="c && $GXMJ_MAC_RUNNABLE2" #-debugger codeide #app3 GXMJ_MAC_RUNNABLE3=~/Documents/MJWork/exec_app/newGXClient_3_11_1-desktop_3.app/Contents/MacOS/newGXClient_3_11_1-desktop_3 alias cc3="c && $GXMJ_MAC_RUNNABLE3" #-debugger codeide #app4 GXMJ_MAC_RUNNABLE4=~/Documents/MJWork/exec_app/newGXClient_3_11_1-desktop_4.app/Contents/MacOS/newGXClient_3_11_1-desktop_4 alias cc4="c && $GXMJ_MAC_RUNNABLE4" #-debugger codeide #-----------------GDMJ project help command-------------- alias c2="python ~/Documents/MJWork/gdmj/ccclient/fast_compile_js2jsc.py" GDMJ_MAC_RUNNABLE1=~/Documents/MJWork/exec_app_gd/newGXClient_3_11_1-desktop_gd_1.app/Contents/MacOS/newGXClient_3_11_1-desktop_gd_1 alias gd1="c2 && $GDMJ_MAC_RUNNABLE1 -workdir ~/Documents/MJWork/gdmj/ccclient -console disable" #-debugger codeide GDMJ_MAC_RUNNABLE2=~/Documents/MJWork/exec_app_gd/newGXClient_3_11_1-desktop_gd_2.app/Contents/MacOS/newGXClient_3_11_1-desktop_gd_2 alias gd2="c2 && $GDMJ_MAC_RUNNABLE2 -workdir ~/Documents/MJWork/gdmj/ccclient -console disable" #-debugger codeide GDMJ_MAC_RUNNABLE3=~/Documents/MJWork/exec_app_gd/newGXClient_3_11_1-desktop_gd_3.app/Contents/MacOS/newGXClient_3_11_1-desktop_gd_3 alias gd3="c2 && $GDMJ_MAC_RUNNABLE3 -workdir ~/Documents/MJWork/gdmj/ccclient -console disable" #-debugger codeide GDMJ_MAC_RUNNABLE4=~/Documents/MJWork/exec_app_gd/newGXClient_3_11_1-desktop_gd_4.app/Contents/MacOS/newGXClient_3_11_1-desktop_gd_4 alias gd4="c2 && $GDMJ_MAC_RUNNABLE4 -workdir ~/Documents/MJWork/gdmj/ccclient -console disable" #-debugger codeide