To run PhpStorm from the shell, use the open command with the following options:
-
-a: specify the application. -
--args: specify additional arguments when passing more than just the file or directory to open. -
-n: open a new instance of the application even if one is already running.
For example, you can run PhpStorm.app with the following command:
open -na "PhpStorm.app"
If PhpStorm is not in the default /Applications directory, specify the full path to it.
You can create a shell script with this command in a directory from your PATH environment variable. For example, create a file /usr/local/bin/ with the following contents:phpstorm
#!/bin/sh
open -na "PhpStorm.app" --args "$@"
Make sure you have permission to execute the script. Give permission to execute phpstorm if needed
chmod 0755 /usr/local/bin/phpstorm
Now you should be able to run phpstorm from anywhere in the shell.
