纸月
Published on 2020-08-25 / 187 Visits
0
0

MAC Android Studio环境及Flutter环境变量配置

这里基于使用的是zsh终端,bash终端配置请自行百度

配置环境前先检查使用cat ~/.zshrc 检查该配置文件是否存在,如果不存在请使用tocuh ~/.zshrc 创建该文件

然后输入vim ~/.zshrc命令打开编辑该文件按a编辑,出现INSERT就可以粘贴下面的配置了 image.png 具体配置如下

#Android abd配置
export ANDROID_HOME=PATH_TO_ANDROID_SDK_DIRECTORY/sdk
export PATH=${PATH}:${ANDROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/platform-tools

#flutter
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
  • PATH_TO_FLUTTER_GIT_DIRECTORY和``PATH_TO_ANDROID_SDK_DIRECTORY 为你AndroidSDK和flutter的路径,比如“~/document/code”

按下键盘ESCINSERT消失之后,输入:wq回车保存 image.png 保存之后输入source ~/.zshrc命令回车更新配置


Comment