Flutter Version Manager. Flutter 多版本管理工具。 本地缓存安装多个 Flutter 版本,随时快速切换
fvm
Flutter Version Management: A simple cli to manage Flutter SDK versions.
Features:
This tool allows you to manage multiple channels and releases, and caches these versions locally, so you don't have to wait for a full setup every time you want to switch versions.
Also, it allows you to grab versions by a specific release, i.e. 1.2.0. In case you have projects in different Flutter SDK versions and do not want to upgrade.
To Install fvm:
brew tap befovy/taps brew install fvm
Or install fvm through
go get
> go get -u -v github.com/befovy/fvm
The command above will install binary executable fvm file to
$GOPATH/bin.
$GOPATH/binto your system PATH, or move the binary fvm file to an existing PATH directory.
And then, for information on each command:
> fvm help
fvm use environment variable
FVM_HOMEas a working path.
If no
FVM_HOMEin environment variable, fvm will use the default value returned by
os.UserConfigDir()append
fvm.
FVM_HOMEis
$HOME/Library/Application Support/fvm
FVM gives you the ability to install many Flutter releases or channels.
> fvm install
Use
masterto install the Master channel and
v1.8.0to install the release.
Use
--repoto install flutter from unoffical repo ```bash
fvm install master --repo https://github.com/flutter/flutter.git ```
FVM has subcommand
importwhich can import your previous installed flutter into fvm.
> fvm import
If you have installed master channel flutter, just use
fvm import master.
fvm import xianyu
You can use the installed Flutter SDK versions for your computer user account globally. To do that just:
> fvm use
Also, you can use different Flutter SDK versions per project. To do that you have to go into the root of the project and:
> fvm use --locol
Get current active Flutter sdk version, link path and actually path
> fvm current
Using the remove command will uninstall the SDK version locally. This will impact any projects that depend on that version of the SDK.
> fvm remove
List all the versions that are installed on your machine.
> fvm list
After add fvm global path to your system environment variable,
fluttercommand is usable every where.
Your will get tip when you run
fvm usefirstly.
Flutter command within
fvmproxies all calls to the CLI just changing the SDK to be the local one.
> fvm flutter run
This will run
flutter runcommand using the local project SDK. If no FVM config is found in the project. FMV will recursively try for a version in a parent directory.
If FVM config is still not found, this will run
flutter runcommand using the global Flutter SDK.
FVM creates a symbolic link within your project called .fvm/current which links to the installed version of the SDK.
Add
$(pwd)/.fvm/current/binto your PATH, or ```bash
.fvm/current/bin/flutter run ```
This will run
flutter runcommand using the local project SDK.
As an example calling
fvm flutter runis the equivalent of calling
flutter runusing the local project SDK.
This project is licensed under the Apache License 2.0 License - see the LICENSE file for details