PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, October 6, 2022

[FIXED] How to setup multiple flutter versions on mac?

 October 06, 2022     flutter, macos, macos-big-sur, terminal     No comments   

Issue

I want to install both flutter v1.22.6 and v2.0.5 on my mac.

currently I have v1.22.6 set up on my mac and have path for it set aswell.

I want a setup where if I enter the command flutter doctor that corresponds to v1.22.6 and when I enter the command flutter2 doctor that corresponds to v2.0.5

enter image description here

I am new to the terminal can someone please help? as of now flutter doctor corresponds to v1.22.6 only. I tried setting a path for flutter2 but that shows as no command found

enter image description here


Solution

You need to create alias

  1. Navigate to your home directory:

    cd ~

  2. Open up .bash_profile using vi:

    vi .bash_profile or vim .bash_profile

  3. Add an alias (press i):

    alias flutter2="~/place_of_folder/flutter2/bin/flutter"

  4. Save the file (press Escape, type :wq, and hit Enter)

  5. Restart Terminal



Answered By - Nuts
Answer Checked By - Marilyn (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing