Skip to content

Instantly share code, notes, and snippets.

@ma-he-sh
Last active February 13, 2023 11:02
Show Gist options
  • Select an option

  • Save ma-he-sh/db75f207f5cfa3461fe964698102b2e3 to your computer and use it in GitHub Desktop.

Select an option

Save ma-he-sh/db75f207f5cfa3461fe964698102b2e3 to your computer and use it in GitHub Desktop.

Revisions

  1. ma-he-sh revised this gist Jun 17, 2018. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions installAndroid.sh
    Original file line number Diff line number Diff line change
    @@ -11,6 +11,7 @@ installJDK (){
    sudo add-apt-repository ppa:webupd8team/java
    sudo apt-get update
    sudo apt-get install oracle-java8-installer
    export JAVA_HOME=$(update-alternatives --query javac | sed -n -e 's/Best: *\(.*\)\/bin\/javac/\1/p')
    }

    # Download Android Studio
  2. ma-he-sh revised this gist Jun 17, 2018. 1 changed file with 10 additions and 1 deletion.
    11 changes: 10 additions & 1 deletion installAndroid.sh
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,15 @@
    # Install Android Studio and create Desktop icon
    # Only tested on ElementaryOS

    # Install JDK8
    installJDK (){
    echo "Installing JDK8"
    sudo apt-get install python-software-properties
    sudo add-apt-repository ppa:webupd8team/java
    sudo apt-get update
    sudo apt-get install oracle-java8-installer
    }

    # Download Android Studio
    downloadAndroidS (){
    echo "Downloading Android Studio"
    @@ -31,6 +40,6 @@ installAndroidS (){
    echo "Installing Finished"
    }


    installJDK
    downloadAndroidS
    installAndroidS
  3. ma-he-sh revised this gist Jun 17, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion How to run.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ## Run following commands to install Android Studio
    ## Installing Android Studio on ElementaryOS

    ```sh
    sudo chmod +x installAndroid.sh
  4. ma-he-sh revised this gist Jun 17, 2018. 2 changed files with 6 additions and 2 deletions.
    6 changes: 6 additions & 0 deletions How to run.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    ## Run following commands to install Android Studio

    ```sh
    sudo chmod +x installAndroid.sh
    ./installAndroid.sh
    ```
    2 changes: 0 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,2 +0,0 @@
    sudo chmod +x installAndroid.sh
    ./installAndroid.sh
  5. ma-he-sh created this gist Jun 17, 2018.
    2 changes: 2 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    sudo chmod +x installAndroid.sh
    ./installAndroid.sh
    36 changes: 36 additions & 0 deletions installAndroid.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    #!/usr/bin/env bash

    # Author: Mahesh Ranaweera
    # Install Android Studio and create Desktop icon
    # Only tested on ElementaryOS

    # Download Android Studio
    downloadAndroidS (){
    echo "Downloading Android Studio"
    wget "https://dl.google.com/dl/android/studio/ide-zips/3.1.3.0/android-studio-ide-173.4819257-linux.zip"
    }

    installAndroidS (){
    echo "Installing Android Studio"
    sudo unzip android-studio-ide-173.4819257-linux.zip -d /opt

    mkdir -p "$HOME"/.local/share/applications
    cat > "$HOME"/.local/share/applications/android-studio.desktop <<-EOF
    [Desktop Entry]
    Version=3.1.3
    Type=Application
    Name=Android Studio
    Exec="/opt/android-studio/bin/studio.sh" %f
    Icon=/opt/android-studio/bin/studio.png
    Categories=Development;IDE;
    Terminal=false
    StartupNotify=true
    StartupWMClass=android-studio
    EOF

    echo "Installing Finished"
    }


    downloadAndroidS
    installAndroidS