How to use both Flutter stable and dev SDK on the same machine?

3,644

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

  1. Put the installation files in two different directories one with stable and the other dev and add one of them to the path then you can change the path variable when needed to use the other channel.

  2. Put the flutter repository file in two different directories one with stable and the other with dev then, add the first installation to the path then add an alias to point to the second installation directory.

Share:
3,644
Eleandro Duzentos
Author by

Eleandro Duzentos

https://www.linkedin.com/in/iam-e200/

Updated on December 21, 2022

Comments

  • Eleandro Duzentos
    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
    Eleandro Duzentos almost 4 years
    I 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
    Eleandro Duzentos almost 4 years
    I 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
    Genes almost 4 years
    I 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 or dev versions.
  • NullByte08
    NullByte08 almost 4 years
    after 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
    Mahesh Jamdade over 2 years
    Heres a detailed answer for vscode stackoverflow.com/a/68047743/8253662