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

     

  • 相关阅读:
    [转]MS SQL Server数据库事务锁机制分析
    【z】TCP/IP 网络基础 (v 0.2b)
    理解 SET CHAINED command not allowed within multistatement transaction.
    inux 设置系统时间和硬件时间
    Java IO测试样例字节流字符流
    【转】memcached完全剖析–1. memcached的基础
    【原】squid简单应用
    jstl字符串处理
    位图异或操作
    多个线程的同步执行,优先级控制
  • 原文地址:https://www.cnblogs.com/ljcgood66/p/14589229.html
Copyright © 2011-2022 走看看