-1

how to add android-studio/bin/ to my PATH environmental variable?

muru
  • 197,895
  • 55
  • 485
  • 740

1 Answers1

0

I hope you have installed Android studio like this:

sudo apt-add-repository ppa:paolorotolo/android-studio 
sudo apt-get update 
sudo apt-get install android-studio

Now sudo vi /etc/environment

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/gradle/bin"
JAVA_HOME=/usr/lib/jvm/java-8-oracle
export JAVA_HOME
GRADLE_HOME=/opt/gradle-2.10
export GRADLE_HOME
export SPARK_HOME=/usr/local/spark-1.6.0-bin-hadoop2.6
export PYTHONPATH=/usr/local/spark-1.6.0-bin-hadoop2.6/python

Go to the last entry on the PATH(1st line) just before the double quotes and then add :<Path of android studio> before double quotes

source /etc/environment

Now verify by doing

echo $PATH

you should be able to invoke Android studio from any where now.

As this is an IDE - better to create .desktop for it under /usr/share/applications. I have one for Eclipse IDE

root@ashu-700-430qe:/usr/share/applications# cat eclipse.desktop
[Desktop Entry]
Name=Eclipse 4
Type=Application
Exec=/opt/eclipse/eclipse
Terminal=false
Icon=/opt/eclipse/icon.xpm
Comment=Integrated Development Environment
NoDisplay=false
Categories=Development;IDE;
Name[en]=Eclipse

You can also create something like that.

Ashu
  • 3,966