zoukankan      html  css  js  c++  java
  • Mac环境搭建flutter并配置环境变量

    Windows环境搭建flutter

    https://blog.csdn.net/ytfunnysite/article/details/81070066

    克隆项目

    git clone https://github.com/flutter/flutter.git
    配置变量,使用中国镜像

    进入当前用户的home目录 输入
    cd ~

    创建.bash_profile 输入
    touch .bash_profile

    编辑.bash_profile文件
    open -e .bash_profile

    如果已存在 .bash_profile

    编辑文件

    vim ~/.bash_profile


    配置镜像
    export PUB_HOSTED_URL=https://pub.flutter-io.cn
    export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn


    command + s保存文件
    更新配置的环境变量(保存)
    source .bash_profile

    验证PATH
    echo $PATH

    .bash_profile文件配置ANDROID_HOME环境变量:

    export PUB_HOSTED_URL=https://pub.flutter-io.cn

    export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn 

    export PATH=/Users/(apple自己flutter放置的位置)/flutter/bin:$PATH

    //查看sdk方法就说了 想亲们都知道

    export ANDROID_HOME="/Users/(自己androidsdk路径)/Library/Android/sdk" 

    export PATH=${PATH}:${ANDROID_HOME}/tools 

    export PATH=${PATH}:${ANDROID_HOME}/platform-tools

    //这个如果需要也加上

    export PATH=${PATH}:${ANDROID_HOME}/build-tools/29.0.3(这个是自己安装的sdk中build-tools选项的版本号)



    查看当前flutter版本分支
    flutter channel

    切换flutter稳定版stable分支
    flutter channel stable

    查看和升级flutter版本
    flutter --version
    flutter upgrade
    ————————————————
    版权声明:本文为CSDN博主「杨天福」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/ytfunnysite/article/details/99189417

  • 相关阅读:
    iOS学习-UILabel
    react js
    代理模式
    利用gitbush从git上下载代码到本地
    VS2017企业版密钥
    office2016产品密钥及激活工具
    .netframe初识
    树的遍历——c#实现
    数据结构——总结
    单例模式
  • 原文地址:https://www.cnblogs.com/sundaysme/p/12574157.html
Copyright © 2011-2022 走看看