zoukankan      html  css  js  c++  java
  • flutter 切换环境

    flutter 切换环境

    终端运行flutter channel命令查看当前flutter 环境 分支

    Mac:~ mac$ flutter channel
    Flutter channels:
      master
      dev
      beta
    * stable

    带有*号的为当前分支
    切换分支命令 flutter channel 分支名 比如 flutter channel betaflutter channel dev

     
    Mac:~ mac$ flutter channel dev
    Switching to flutter channel 'dev'...
    git: Switched to a new branch 'dev'
    git: Branch 'dev' set up to track remote branch 'dev' from 'origin'.
    Successfully switched to flutter channel 'dev'.

    运行flutter channel查看是否切换分支成功,如果本地没有要切换的分支命令会执行下载操作

    Downloading Dart SDK from Flutter engine defa8be2b10650dad50dfee9324ed8d16eeec13f...
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  175M  100  175M    0     0  10.0M      0  0:00:17  0:00:17 --:--:-- 10.2M
    Building flutter tool...
    Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure
    you trust this source!
    Downloading Material fonts...                                      456ms
    Downloading package sky_engine...                                  225ms
    Downloading flutter_patched_sdk tools...                         1,376ms
    Downloading flutter_patched_sdk_product tools...                 1,090ms
    Downloading darwin-x64 tools...                                     3.1s
    Downloading libimobiledevice...                                     27ms
    Downloading usbmuxd...                                              47ms
    Downloading libplist...                                             37ms
    Downloading openssl...                                             166ms
    Downloading ios-deploy...                                           29ms
    Downloading darwin-x64/font-subset tools...  

    显示如下

    Flutter channels:
      master
    * dev
      beta
      stable

    即是切换分支成功。
    如果报错信息如下:

    git: error: Your local changes to the following files would be overwritten by checkout:
    git:    packages/flutter/lib/src/widgets/navigator.dart
    git: Please commit your changes or stash them before you switch branches.
    git: Aborting
    Switching channels failed with error code 1.

    cd到本地flutter环境目录下执行git checkout .命令,再次执行切换分支的命令即可成功。

    来源参考:https://www.jianshu.com/p/ada4c6684934

     

  • 相关阅读:
    Python 拷贝对象(深拷贝deepcopy与浅拷贝copy)
    Python学习之字典详解
    IDEA启动服务慢的问题处理
    IDEA部署Tomcat应用所有接口中文乱码
    为什么选择微信公众号而不是小程序的考虑要素
    Vue基础及脚手架环境搭建
    VSCode集成Git代码管理
    VSCode开发工具下载
    U盘装系统:安装GHOST Win7系统教程
    前端资源管理工具sourcetree
  • 原文地址:https://www.cnblogs.com/ljcgood66/p/14589229.html
Copyright © 2011-2022 走看看