Flutter 安装实践

2018-10-01  本文已影响50人  浮生随笔

Flutter 安装

我的安装步骤可能和网络上的步骤不太一样,但是,却是最好用的。
本篇只是安装步骤简单索引,后续会详细解释每一步。

clone flutter SDK 到本地

最好是cd到根目录下操作:

git clone -b master https://github.com/flutter/flutter.git ./flutter/bin/flutter --version

导出环境变量

终端运行:vim ~/.bash_profile

或者:

#Flutter
export PATH=$PATH:/Users/你的Mac名字/flutter/bin
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

flutter doctor

brew update
brew install --HEAD libimobiledevice
brew install ideviceinstaller ios-deploy cocoapods
pod setup

iterm-2 配色导致每次flutter 命令运行或者 source ~/.bash_profile 都会把用户名变为乱码


#Android
#export ANDROID_HOME=/Users/zhouzuosong/Library/Android/sdk
#export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tool
#export PATH=/usr/local/mysql/bin:$PATH

export ANDROID_HOME=/Users/zhouzuosong/Library/Android/sdk 
export PATH=PATH:$ANDROID_HOME/tools:$PATH 
export PATH=PATH:$ANDROID_HOME/platform-tools:$PATH 


#Flutter
export PATH=$PATH:/Users/zhouzuosong/flutter/bin
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export PATH=PATH_TO_FLUTTER_GIT_DIRECTORY/flutter/bin:$PATH


# iterm 配色
# #enables colorin the terminal bash shell export
# export CLICOLOR=1

# #setsup thecolor scheme for list export
# export LSCOLORS=gxfxbEaEBxxEhEhBaDaCaD
 
# #sets up theprompt color (currently a green similar to linux terminal)
# export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\$'

# #enables colorfor iTerm
# export TERM=xterm-256color

拿走不谢~

上一篇下一篇

猜你喜欢

热点阅读