I've just installed Android Studio. After installing, I forgot to add in the launcher. I restarted the system.
Now I want to launch Android Studio from Terminal. I've tried everything but didn't work.
cd
into the directory where you unzipped the android studio installer zip file. The folder is named android-studio. It could be in your ~/Downloads
folder if you downloaded it from the internet. Now cd
into the bin folder and run the studio.sh file
./studio.sh
PATH_TO_ZIP_FILE/android-studio/bin/studio.sh
. For example if the android-studio folder is in downloads directory type $HOME/Downloads/android-studio/bin/studio.sh
Oct 30, 2016 at 16:50
On ubuntu it is /opt/android-studio/bin/studio.sh
You can open terminal by CTRL+ALT+T
just run this command into your terminal
cd /usr/local/android-studio/bin
/usr/local/android-studio/bin$ ./studio.sh
option 1 : set path alias in bashrc file by echo command
echo "alias android='/usr/local/android-studio/bin/studio.sh'" >> ~/.bashrc
source .bashrc
option 2 : set path alias by opening bashrc file.
open bashrc file on nano editor
nano ~/.bashrc
paste this text in bashrc file
alias android='/usr/local/android-studio/bin/studio.sh'
ctrl + S to save file . Ctrl + X to exit.
finally source it
source ~/.bashrc
To run android studio, you need to type only
android
If you want to use terminal to start a program then you should be knowing the command to be written in terminal. To know the command in Kubuntu I use the Kmenuedit. In kmenuedit find that program and that program's details there will be a field named command there you will find text to be written in terminal. Another option is to check system monitor program that also has a column named command. So you can check running instances of programs and command.
Go to android studio folder in your system then
1. Press right click of mouse and open terminal
2. wright ./studio.sh
and press enter
3. it would open your android emulator in ubuntu
Launching Android Studio using Terminal with SUDO privileges
(ctrl + alt + t)
sudo su
command then enters your password. cd /opt/android-studio/bin
sh ./studio.sh
I tried to reduce job by setting an environment variable
echo "alias android_studio=/usr/local/android-studio/bin/studio.sh" >> ~/.bashrc
source .bashrc
Whenever want to open Android Studio just fire command
android_studio
I hope this will reduce your work.
Good luck..!