How to run a project in godot from command on Mac?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By alexzheng
:warning: Old Version Published before Godot 3 was released.

I can only run /Applications/Godot.app/Contents/MacOS/Godot to start the godot editor with the project list window.
If I run this command inside the project, it won’t start this project.
And it also can not run a scene by
/Applications/Godot.app/Contents/MacOS/Godot scene.tscn

Has anybody successfully run these commands from Mac OS ?

:bust_in_silhouette: Reply From: razah

Placing the Godot binary in /usr/local/bin and making sure it is called godot

  1. in terminal. create bash_profile file if not exist;

    touch ~/.bash_profile
    
  2. open file with TextEdit;

    open -a TextEdit ~/.bash_profile
    
  3. paste this export PATH=/usr/local/bin:$PATH into TextEdit. save
    and close.

  4. apply changes;

    source ~/.bash_profile
    
  5. Create symlink for Godot binary;

    ln -s /Applications/Godot.app/Contents/MacOS/Godot /usr/local/bin/godot
    

Finally Read Command line tutorial

:bust_in_silhouette: Reply From: GeM

Nowadays, default Mac Terminal is ZSH.
Henceforth:

echo 'alias godot="/Applications/Godot.app/Contents/MacOS/Godot"' >> ~/.zprofile && source .zprofile && which godot

Edited thanks to @razah’s comment (zsh - What should/shouldn't go in .zshenv, .zshrc, .zlogin, .zprofile, .zlogout? - Unix & Linux Stack Exchange for more ZSH configuration information).

use ~/.zprofile instead of ~/.zshrc

% echo 'alias godot="/Applications/Godot.app/Contents/MacOS/Godot"' >> ~/.zprofile

or as a symlink

% ln -s /Applications/Godot.app/Contents/MacOS/Godot /usr/local/bin/godot

Then restart terminal, Let’s test which file path it is;

% which godot
/usr/local/bin/godot

razah | 2020-09-27 11:04