Ubuntu – Start Android Studio from any directory

android-studiobashcommand line

In the installation instructions for Android Studio they say:

3. [OPTIONAL] Add "{installation home}/bin" to your PATH environment
 variable so that you may start Android Studio from any directory.

I did that according to this Stack Overflow question. But how do I start it now? The problem is I need to execute a shell script studio.sh and I am afraid these are not visible for the PATH variable.

I should be able to call it in any directory in terminal by calling just studio.sh.

EDIT: more info

studio.sh runs the Android Studio

I followed the official installation instruction which came with the android-studio zip file (form official website).

I added

export PATH=$PATH:$HOME/Installs/android-studio/bin

at the end of ~/.profile.

Adding more outputs:

$ ls -l $HOME/Installs/android-studio/bin/studio.sh
-rwxr-xr-x 1 roman roman 6985 bře 21 18:26 /home/roman/Installs/android-studio/bin/studio.sh

$ echo $PATH
/home/roman/bin:/home/roman/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/roman/Installs/android-studio/bin/studio.sh

$ type studio.sh
bash: type: studio.sh: not found

Best Answer

This is the last item in your PATH:

/home/roman/Installs/android-studio/bin/studio.sh

The problem is that items in the PATH need to be directories but you've added a file. I'm not sure how this happened since it doesn't match the export PATH=... line you posted.