TUTORIAL — Quality of Life

Updating the PATH variable for Flutter

on Mac in the bash shell using ‘vim’

Updating the PATH variable for Flutter on Mac

If you want to use the Flutter command-line tools on your Mac, you’ll need to update your PATH variable to include the Flutter tools directory.

This will allow you to run Flutter commands from any directory on your system, rather than having to navigate to the Flutter tools directory every time you want to use them.

Um die PATH-Variable auf Ihrem Mac zu aktualisieren, müssen Sie das Flutter-Tools-Verzeichnis zu Ihrer Datei „~/.bash_profile“ hinzufügen.

This file is a script that is executed whenever you open a new terminal window, and it’s used to set up your environment variables.

Führen Sie das unten stehende Kommando in einem Terminalfenster aus, um Ihre Shell von ‚zsh‘ auf ‚bash‘ umzustellen, und starten Sie dann Ihr Terminal neu. Neue Terminal-Fenster werden mit der ‚bash‘ geöffnet.

				
					'chsh -s /bin/bash'
				
			
To make sure the shell change was successful, enter the following:
				
					echo $SHELL
				
			

Die Ausgabe sollte ‚/bin/bash‘ sein.

Um Ihre Datei „~/.bash_profile“ mit dem Texteditor „vim“ zu bearbeiten, geben Sie folgenden Befehl ein:

				
					vim ~/.bash_profile
				
			

Dadurch wird die Datei „~/.bash_profile“ in „vim“ geöffnet.

Drücken Sie die Taste ‚i‘, um in den Einfügemodus zu gelangen. Damit können Sie die Datei bearbeiten.
Add the following line to the end of the file (last line):

				
					export PATH="$PATH:/path/to/flutter/bin"
				
			

Stellen Sie sicher, dass Sie ‚/path/to/flutter/bin‘ durch den tatsächlichen Pfad zum Verzeichnis der Flutter-Tools auf Ihrem System ersetzen. Sie können dieses Verzeichnis finden, indem Sie den Befehl ‚which flutter‘ in einem Terminalfenster ausführen.

1. Drücken Sie die ‚Esc‘-Taste, um den Einfügemodus zu verlassen.

2. Um die Änderungen zu speichern und ‚vim‘ zu beenden, geben Sie den folgenden Befehl ein und drücken ‚Eingabe‘:

				
					:wq
				
			

This will write the changes to the file and quit the editor.

Führen Sie den folgenden Befehl aus, um Ihre Datei „~/.bash_profile“ neu zu laden:

				
					source ~/.bash_profile
				
			
This will update your PATH variable with the Flutter tools directory, and you’ll be able to run Flutter commands from any directory on your system.

Es ist zu beachten, dass die Änderungen, die Sie in der Datei ‚~/.bash_profile‘ vornehmen, nur in neuen Terminalfenstern wirksam werden.

Wenn Sie die Flutter-Befehlszeilenwerkzeuge in einem bestehenden Terminalfenster verwenden wollen, müssen Sie den Befehl ’source ~/.bash_profile‘ erneut ausführen, um die Datei neu zu laden.

Um die PATH-Variable für Flutter auf Ihrem Mac mit ‚vim‘ zu aktualisieren, müssen Sie Ihre ‚~/.bash_profile‘-Datei so bearbeiten, dass sie das Flutter-Werkzeugverzeichnis enthält.

This will allow you to run Flutter commands from any directory on your system, making it straightforward to use the Flutter command-line tools.

We hope this was useful to you and as always…

Happy coding!

If you need help developing your app, be sure to contact us at:

https://eclectify.com/contact

Become a 6-figure income Flutter developer with step-by-step guidance from professors with real-life experience! Start your journey today at:

https://university.eclectify.com/

Found this article helpful and want to know more about Flutter? Find our other blogs here:

https://eclectify.com/blogs

Newsletter

Join our mailing list for tips, tricks and updates about Flutter app development!

Shortcut to becoming a Flutter developer with a 6 figure income

Become a part of our eclectify University and take your skills to the next level.  Don't wait - enroll now and start learning today!

If you want to use the Flutter command-line tools on your Mac, you’ll need to update your PATH variable to include the Flutter tools directory.

This will allow you to run Flutter commands from any directory on your system, rather than having to navigate to the Flutter tools directory every time you want to use them.

 

Um die PATH-Variable auf Ihrem Mac zu aktualisieren, müssen Sie das Flutter-Tools-Verzeichnis zu Ihrer Datei „~/.bash_profile“ hinzufügen.

This file is a script that is executed whenever you open a new terminal window, and it’s used to set up your environment variables.

Führen Sie das unten stehende Kommando in einem Terminalfenster aus, um Ihre Shell von ‚zsh‘ auf ‚bash‘ umzustellen, und starten Sie dann Ihr Terminal neu. Neue Terminal-Fenster werden mit der ‚bash‘ geöffnet.

				
					'chsh -s /bin/bash'
				
			
To make sure the shell change was successful, enter the following:
				
					echo $SHELL
				
			

Die Ausgabe sollte ‚/bin/bash‘ sein.

Um Ihre Datei „~/.bash_profile“ mit dem Texteditor „vim“ zu bearbeiten, geben Sie folgenden Befehl ein:

				
					vim ~/.bash_profile
				
			

Dadurch wird die Datei „~/.bash_profile“ in „vim“ geöffnet.

Drücken Sie die Taste ‚i‘, um in den Einfügemodus zu gelangen. Damit können Sie die Datei bearbeiten.
Add the following line to the end of the file (last line):

				
					export PATH="$PATH:/path/to/flutter/bin"
				
			

Stellen Sie sicher, dass Sie ‚/path/to/flutter/bin‘ durch den tatsächlichen Pfad zum Verzeichnis der Flutter-Tools auf Ihrem System ersetzen. Sie können dieses Verzeichnis finden, indem Sie den Befehl ‚which flutter‘ in einem Terminalfenster ausführen.

1. Drücken Sie die ‚Esc‘-Taste, um den Einfügemodus zu verlassen.

2. Um die Änderungen zu speichern und ‚vim‘ zu beenden, geben Sie den folgenden Befehl ein und drücken ‚Eingabe‘:

				
					:wq
				
			

This will write the changes to the file and quit the editor.

Führen Sie den folgenden Befehl aus, um Ihre Datei „~/.bash_profile“ neu zu laden:

				
					source ~/.bash_profile
				
			
This will update your PATH variable with the Flutter tools directory, and you’ll be able to run Flutter commands from any directory on your system.
Es ist zu beachten, dass die Änderungen, die Sie in der Datei ‚~/.bash_profile‘ vornehmen, nur in neuen Terminalfenstern wirksam werden.
Wenn Sie die Flutter-Befehlszeilenwerkzeuge in einem bestehenden Terminalfenster verwenden wollen, müssen Sie den Befehl ’source ~/.bash_profile‘ erneut ausführen, um die Datei neu zu laden.
Um die PATH-Variable für Flutter auf Ihrem Mac mit ‚vim‘ zu aktualisieren, müssen Sie Ihre ‚~/.bash_profile‘-Datei so bearbeiten, dass sie das Flutter-Werkzeugverzeichnis enthält.
This will allow you to run Flutter commands from any directory on your system, making it straightforward to use the Flutter command-line tools.

 

We hope this was useful to you and as always…

Happy coding!

If you need help developing your app, be sure to contact us at:

https://eclectify.com/contact

Become a 6-figure income Flutter developer with step-by-step guidance from professors with real-life experience! Start your journey today at:

https://university.eclectify.com/

Found this article helpful and want to know more about Flutter? Find our other blogs here:

https://eclectify.com/blogs

Newsletter

Join our mailing list for tips, tricks and updates about Flutter app development!

Shortcut to becoming a Flutter developer with a 6 figure income

Become a part of our eclectify University and take your skills to the next level.  Don't wait - enroll now and start learning today!

Ready

Start your own project with Eclectify!

to start?

Ready

Start your own project with Eclectify!

to start?

And

now?

Start your own project with Eclectify!

Eclectify | John-F.-Kennedy-Straße 5-7 | 89231 Neu-Ulm

At Eclectify, we merge creativity and technical expertise to navigate you through your digital challenges. As your trusted agency based in Ulm, we are here to serve you, no matter where you are located.

CONTACT US
 
 
info@eclectify.com
 

Eclectify

John-F.-Kennedy-Straße 5-7

89231 Neu-Ulm

At Eclectify, we merge creativity and technical expertise to navigate you through your digital challenges. As your trusted agency based in Ulm, we are here to serve you, no matter where you are located.

CONTACT US
 
info@eclectify.com