Flutter镜像配置

2022-04-28  本文已影响0人  心猿意码_

Flutter中文网:https://www.flutterchina.club/setup-macos

export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
image.png
配置:
410317-20200911134738696-1997435369.png
没有显示的->请的按 "command + shift + ."
或者:在终端输入:
defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder
如果没有 .bash_proflile文件按下面方法新建。
1. 启动终端Terminal

2. 进入当前用户的home目录

    输入cd ~

3. 创建.bash_profile

    输入touch .bash_profile

4. 编辑.bash_profile文件

    输入open .bash_profile

  在弹出的页面进行编辑

5. 保存文件,关闭.bash_profile

6. 更新刚配置的环境变量

    输入source .bash_profile

可能会提示你,文件不属你的,不能修改。

选中文件点右键-》显示简介-拉到最下面 加入权限


410317-20200911135443779-2137858144.png
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

在终端输入 source ~/.bash_profile 生效。

输入

export PATH=xxxxxx/flutter/bin:$PATH

(xxxxxxx为flutter在本机上的路径,蓝色路径,可以找到flutter下的bin文件夹直接拖进来即可)

终端还是要命令行输入source ~/.bash_profile生效

回到命令行,输入flutter doctor


image.png
大功告成!!!
上一篇下一篇

猜你喜欢

热点阅读