Android Studio desktop shortcut

5,509

If you place Android Studio in /usr/share/applications or any folder except your home user folder, you will need root privileges to execute the program.

In fact, if you try to execute in terminal <folder where you installed Android Studio>/android-studio/bin/studio.sh, you will be asked to enter root password. Yet, if you click on the icon of Android Studio nothing happens (nor password requests).

One way to avod this is to prompt a dialog box where to enter password. Install gksu by typing in terminal sudo apt-get install gksu; then edit your desktop file and in Exec entry write gksu /<folder where you installed Android Studio>/android-studio/bin/studio.sh.

Share:
5,509

Related videos on Youtube

rainman
Author by

rainman

Updated on September 18, 2022

Comments

  • rainman
    rainman over 1 year

    I made an android desktop file in ubuntu 15.04 as follows:

    [Desktop Entry]
    Version=1.0
    Type=Application
    Name=Android Studio
    Exec="/home/user/android-studio/bin/studio.sh" %f
    Icon=/home/user/android-studio/bin/studio.png
    Categories=Development;IDE;
    Terminal=false
    StartupNotify=true
    StartupWMClass=jetbrains-android-studio
    Name[en_GB]=android-studio.desktop
    

    it shows the icon, and everything seems to be fine, but when i try to open it, does not open, with no error message. i have android studio version 1.3 preview

    this is the output of ls -la /home/user/android-studio/bin/studio.sh

    -rwxrwxr-x 1 user user 6273 may 29 22:43 android-studio/bin/studio.sh
    
    • A.B.
      A.B. almost 9 years
      Your desktop file is ok. Edit your question and add the output of ls -la /home/user/android-studio/bin/studio.sh and try to start Android Studio in a terminal with /home/user/android-studio/bin/studio.sh and post the output also in your question.
    • rainman
      rainman almost 9 years
      from terminal it starts normaly, i don't know why not from the .desktop
    • A.B.
      A.B. almost 9 years
      Only an idea, try this Exec=/home/user/android-studio/bin/studio.sh in the desktop file.
    • rainman
      rainman almost 9 years
      it does not work.
    • A.B.
      A.B. almost 9 years
      The desktop file is a little too big. Remove the file and create a new one with the lines posted in your question. My file has only 286. You have 6273.
    • rainman
      rainman almost 9 years
      now it has 269 and still does not start, thank you anyway.
    • A.B.
      A.B. almost 9 years
      Please post the output of ls -la ~/.local/share/applications/android-studio.desktop , assumed android-studio.desktop is your desktop file.
    • rainman
      rainman almost 9 years
      i have no desktop file for android studio in the location ~/.local/share/applications/ , should it be there ?
    • A.B.
      A.B. almost 9 years
      Where is your desktop file?
    • A.B.
      A.B. almost 9 years