How to use both Flutter stable and dev SDK on the same machine?
Solution 1
I found this Dart package called Flutter Version Management that does exactly what I want.
As the docs says:
Flutter Version Management: A simple cli to manage Flutter SDK versions.
Features:
- Configure and use Flutter SDK version per project
- Ability to install and cache multiple Flutter SDK Versions
- Fast switch between Flutter channels & versions
- Dynamic SDK paths for IDE debugging support.
- Version FVM config with a project for consistency across teams and CI environments.
- Set global Flutter version across projects
https://github.com/leoafarias/fvm
Now I just need to add FVM_HOME/default/bin
to the PATH
and FVM
will take care of everything...
Solution 2
You'll need to setup alias to switch between different environments easily.
See here a detailed article for that.
Solution 3
Two solutions
-
Put the installation files in two different directories one with
stable
and the otherdev
and add one of them to the path then you canchange the path variable when needed
to use the other channel. -
Put the flutter repository file in two different directories one with
stable
and the other withdev
then, add the first installation to the path thenadd an alias to point to the second installation directory
.
Comments
-
Eleandro Duzentos over 1 year
I'm working with Flutter to make a Mobile App using the stable Flutter SDK release. But I also want to try Flutter Desktop and Flutter Web that are not part of the Flutter stable channel yet, but are present on the Flutter dev channel.
My question is... How can I try Flutter Desktop and Flutter Web without override the Flutter stable release on my machine?
-
Eleandro Duzentos almost 4 yearsI want to use Flutter with vscode and vscode as many other Flutter tools calls the "flutter" executable available on the PATH, if I setup a release with another alias than this, then I want be able to provide the right executable to these tools. Is there any way that I can change the channel and set it as the default executable on the PATH so I don't need to rely on aliases?
-
Eleandro Duzentos almost 4 yearsI want to use Flutter with vscode and vscode as many other Flutter tools calls the "flutter" executable available on the PATH, if I setup a release with another alias than this, then I want be able to provide the right executable to these tools. Is there any way that I can change the channel and set it as the default executable on the PATH so I don't need to rely on aliases?
-
Genes almost 4 yearsI have edited my answer if you plan to use vs code then have to be swapping the path variable every time you want to use
stable
ordev
versions. -
NullByte08 almost 4 yearsafter setting the flutter sdk in android studio according to the guide, can I use the run button or do I need to type flutterb run command everytime?
-
Mahesh Jamdade over 2 yearsHeres a detailed answer for vscode stackoverflow.com/a/68047743/8253662