Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how Add "{installation home}/bin" to your PATH environment variable so that you can start Android Studio from any directory

I have download the android-studio android-studio-ide-202.7351085-linux.tar.gz file from develop.android.com and I have extracted this file to /opt/android-studio folder so that the android studio software should be installed on root directory. I don't want to install it in /home/Downloads directory. but I have not shown any software icon on my app bar and search bar. I want to know why and I also want to set path environment variable for run/start the android studio from any directory.

as it mentioned in install_linux.tar the instruction is 3 and 4.

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

4. [OPTIONAL] To adjust the value of the JVM heap size, create a file studio.vmoptions (or studio64.vmoptions if using a 64-bit JDK) in the configuration directory and set the -Xms and -Xmx parameters. To see how to do this, you can reference the vmoptions file under "{installation home}/bin" as a model but do not modify it, add your options to the new file.

my purpose of installing android-studio is for learning app development in flutter.

like image 248
amarjeet singh Avatar asked Dec 08 '25 14:12

amarjeet singh


2 Answers

Short answer:

  1. Go to your home directory.
  2. Type ls -a
  3. You should see file named .bashrc (perhaps you will see file named .zshrc insead - then replace .bashrc with .zshrc)
  4. Type nano .bashrc
  5. Add this line to the end of file: export PATH=/path/to/your/instalation/directory/android-studio/bin:$PATH
  6. Press CTRL+s, then CTRL+x
  7. Reload with source ~/.bashrc

Long answer:

I had the same problem and I found this site https://linuxhint.com/add-directory-to-path-linux/, where is everything explained to details. I would recommend reading it.

like image 153
Slurfer Avatar answered Dec 10 '25 04:12

Slurfer


I found a simpler method.

On the android studio Menu Bar press Tools and then Create Desktop Entry

like image 31
mariko Avatar answered Dec 10 '25 05:12

mariko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!