Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save manfe/6e33f34195bc9d599585d41c1c1ab29e to your computer and use it in GitHub Desktop.
Save manfe/6e33f34195bc9d599585d41c1c1ab29e to your computer and use it in GitHub Desktop.

Revisions

  1. manfe revised this gist Jun 4, 2021. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions Install Android SDK CLI Ubuntu 20.04 WSL2.md
    Original file line number Diff line number Diff line change
    @@ -39,6 +39,7 @@ sudo apt install gradle
    if the commands is working here. You should set the exports to your .bash_profile, so you dont need to export everytime you open it (WSL).

    ````
    echo "source ~/.bashrc" >> ~/.bash_profile
    echo "export ANDROID_HOME=$HOME/Android" >> .bash_profile
    echo 'export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$PATH"' >> .bash_profile
    ````
  2. manfe revised this gist Jun 4, 2021. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions Install Android SDK CLI Ubuntu 20.04 WSL2.md
    Original file line number Diff line number Diff line change
    @@ -32,13 +32,15 @@ sdkmanager --licenses

    sudo apt install gradle

    ````

    ## SETUP PATH WHEN LOADING UBUNTU BASH

    # if the commands is working here. You should set the exports to your .bash_profile, so you dont need to export everytime you open it (WSL).
    if the commands is working here. You should set the exports to your .bash_profile, so you dont need to export everytime you open it (WSL).

    ````
    echo "export ANDROID_HOME=$HOME/Android" >> .bash_profile
    echo 'export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$PATH"' >> .bash_profile

    ````

    Note: you can get an updated Android SDK link from https://developer.android.com/studio/#downloads
  3. manfe revised this gist Jun 4, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Install Android SDK CLI Ubuntu 20.04 WSL2.md
    Original file line number Diff line number Diff line change
    @@ -34,7 +34,7 @@ sudo apt install gradle

    ## SETUP PATH WHEN LOADING UBUNTU BASH

    if it's working until the commands until here. You should set the exports to your .bash_profile, so you dont need to export everytime you open it.
    # if the commands is working here. You should set the exports to your .bash_profile, so you dont need to export everytime you open it (WSL).

    echo "export ANDROID_HOME=$HOME/Android" >> .bash_profile
    echo 'export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$PATH"' >> .bash_profile
  4. manfe revised this gist Jun 4, 2021. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions Install Android SDK CLI Ubuntu 20.04 WSL2.md
    Original file line number Diff line number Diff line change
    @@ -32,6 +32,12 @@ sdkmanager --licenses

    sudo apt install gradle

    ## SETUP PATH WHEN LOADING UBUNTU BASH

    if it's working until the commands until here. You should set the exports to your .bash_profile, so you dont need to export everytime you open it.
    echo "export ANDROID_HOME=$HOME/Android" >> .bash_profile
    echo 'export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$PATH"' >> .bash_profile
    ````
  5. manfe revised this gist Jun 4, 2021. 1 changed file with 13 additions and 15 deletions.
    28 changes: 13 additions & 15 deletions Install Android SDK CLI Ubuntu 20.04 WSL2.md
    Original file line number Diff line number Diff line change
    @@ -3,26 +3,31 @@
    ## Install Java 8

    ```bash
    sudo apt install openjdk-8-jdk-headless
    sudo apt install openjdk-14-jdk
    ```

    ## Android SDK

    ```bash
    wget https://dl.google.com/android/repository/commandlinetools-linux-6200805_latest.zip
    mkdir -p Android/Sdk
    unzip commandlinetools-linux-6200805_latest.zip -d Android/Sdk
    wget https://dl.google.com/android/repository/commandlinetools-linux-7302050_latest.zip
    unzip commandlinetools-linux-6200805_latest.zip -d Android

    export ANDROID_HOME=$HOME/Android/Sdk
    mkdir Android/cmdline-tools/latest
    mv Android/cmdline-tools/NOTICE.txt Android/cmdline-tools/latest
    mv Android/cmdline-tools/bin Android/cmdline-tools/latest
    mv Android/cmdline-tools/lib Android/cmdline-tools/latest
    mv Android/cmdline-tools/source.properties Android/cmdline-tools/latest

    export ANDROID_HOME=$HOME/Android
    # Make sure emulator path comes before tools. Had trouble on Ubuntu with emulator from /tools being loaded
    # instead of the one from /emulator
    export PATH="$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH"
    export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$PATH"

    sdkmanager --sdk_root=${ANDROID_HOME} "tools"
    sdkmanager --sdk_root=${ANDROID_HOME}

    sdkmanager --update
    sdkmanager --list
    sdkmanager "build-tools;28.0.3" "platform-tools" "platforms;android-28" "tools"
    sdkmanager "build-tools;30.0.3" "platform-tools" "platforms;android-30" "tools"
    sdkmanager --licenses

    sudo apt install gradle
    @@ -31,10 +36,3 @@ sudo apt install gradle
    ````

    Note: you can get an updated Android SDK link from https://developer.android.com/studio/#downloads

    Used a combinaton of these gists:
    https://gist.github.com/fedme/fd42caec2e5a7e93e12943376373b7d0
    https://gist.github.com/jjvillavicencio/18feb09f0e93e017a861678bc638dcb0

    Background on the update to command line tools from android sdk
    https://stackoverflow.com/a/61176718
  6. @steveclarke steveclarke revised this gist Dec 7, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Install Android SDK CLI Ubuntu 20.04 WSL2.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Install Android SDK CLI (Work in Progress)
    # Install Android SDK CLI Ubuntu 20.04 WSL2 (Work in Progress)

    ## Install Java 8

  7. @steveclarke steveclarke revised this gist Sep 24, 2020. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Install Android SDK CLI Ubuntu 20.04 WSL2.md
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,8 @@ sudo apt install openjdk-8-jdk-headless

    ```bash
    wget https://dl.google.com/android/repository/commandlinetools-linux-6200805_latest.zip
    unzip commandlinetools-linux-6200805_latest.zip -d Android
    mkdir -p Android/Sdk
    unzip commandlinetools-linux-6200805_latest.zip -d Android/Sdk

    export ANDROID_HOME=$HOME/Android/Sdk
    # Make sure emulator path comes before tools. Had trouble on Ubuntu with emulator from /tools being loaded
  8. @steveclarke steveclarke revised this gist Jun 16, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Install Android SDK CLI Ubuntu 20.04 WSL2.md
    Original file line number Diff line number Diff line change
    @@ -12,10 +12,10 @@ sudo apt install openjdk-8-jdk-headless
    wget https://dl.google.com/android/repository/commandlinetools-linux-6200805_latest.zip
    unzip commandlinetools-linux-6200805_latest.zip -d Android

    export ANDROID_HOME=$HOME/Android
    export ANDROID_HOME=$HOME/Android/Sdk
    # Make sure emulator path comes before tools. Had trouble on Ubuntu with emulator from /tools being loaded
    # instead of the one from /emulator
    PATH="$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH"
    export PATH="$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH"

    sdkmanager --sdk_root=${ANDROID_HOME} "tools"

  9. @steveclarke steveclarke revised this gist May 10, 2020. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion Install Android SDK CLI Ubuntu 20.04 WSL2.md
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,9 @@ wget https://dl.google.com/android/repository/commandlinetools-linux-6200805_lat
    unzip commandlinetools-linux-6200805_latest.zip -d Android

    export ANDROID_HOME=$HOME/Android
    PATH="$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH"
    # Make sure emulator path comes before tools. Had trouble on Ubuntu with emulator from /tools being loaded
    # instead of the one from /emulator
    PATH="$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH"

    sdkmanager --sdk_root=${ANDROID_HOME} "tools"

  10. @steveclarke steveclarke revised this gist May 10, 2020. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion Install Android SDK CLI Ubuntu 20.04 WSL2.md
    Original file line number Diff line number Diff line change
    @@ -31,4 +31,7 @@ Note: you can get an updated Android SDK link from https://developer.android.com

    Used a combinaton of these gists:
    https://gist.github.com/fedme/fd42caec2e5a7e93e12943376373b7d0
    https://gist.github.com/jjvillavicencio/18feb09f0e93e017a861678bc638dcb0
    https://gist.github.com/jjvillavicencio/18feb09f0e93e017a861678bc638dcb0

    Background on the update to command line tools from android sdk
    https://stackoverflow.com/a/61176718
  11. @steveclarke steveclarke revised this gist May 10, 2020. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions Install Android SDK CLI Ubuntu 20.04 WSL2.md
    Original file line number Diff line number Diff line change
    @@ -16,6 +16,15 @@ export ANDROID_HOME=$HOME/Android
    PATH="$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH"

    sdkmanager --sdk_root=${ANDROID_HOME} "tools"

    sdkmanager --update
    sdkmanager --list
    sdkmanager "build-tools;28.0.3" "platform-tools" "platforms;android-28" "tools"
    sdkmanager --licenses

    sudo apt install gradle


    ````

    Note: you can get an updated Android SDK link from https://developer.android.com/studio/#downloads
  12. @steveclarke steveclarke revised this gist May 10, 2020. 1 changed file with 10 additions and 3 deletions.
    13 changes: 10 additions & 3 deletions Install Android SDK CLI Ubuntu 20.04 WSL2.md
    Original file line number Diff line number Diff line change
    @@ -8,10 +8,17 @@ sudo apt install openjdk-8-jdk-headless

    ## Android SDK

    ○ → wget https://dl.google.com/android/repository/commandlinetools-linux-6200805_latest.zip
    Note: you can get an updated Android SDK link from https://developer.android.com/studio/#downloads
    ```bash
    wget https://dl.google.com/android/repository/commandlinetools-linux-6200805_latest.zip
    unzip commandlinetools-linux-6200805_latest.zip -d Android

    export ANDROID_HOME=$HOME/Android
    PATH="$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH"

    ○ → sdkmanager --sdk_root=${ANDROID_HOME} "tools"
    sdkmanager --sdk_root=${ANDROID_HOME} "tools"
    ````

    Note: you can get an updated Android SDK link from https://developer.android.com/studio/#downloads

    Used a combinaton of these gists:
    https://gist.github.com/fedme/fd42caec2e5a7e93e12943376373b7d0
  13. @steveclarke steveclarke revised this gist May 10, 2020. 1 changed file with 8 additions and 19 deletions.
    27 changes: 8 additions & 19 deletions Install Android SDK CLI Ubuntu 20.04 WSL2.md
    Original file line number Diff line number Diff line change
    @@ -1,29 +1,18 @@
    # Install Android SDK CLI (Work in Progress)

    ```bash
    sudo apt install android-sdk
    ```

    Installs to `/usr/lib/android-sdk`


    ## Install Java 8

    ```bash
    sudo apt install openjdk-8-jdk
    sudo apt install openjdk-8-jdk-headless
    ```

    Set default `java` and `javac` to v8
    ## Android SDK

    ```bash
    sudo update-alternatives --config java
    sudo update-alternatives --config javac
    ```

    Set `JAVA_HOME`. Add the following to `~/.bashrc`
    ○ → wget https://dl.google.com/android/repository/commandlinetools-linux-6200805_latest.zip
    Note: you can get an updated Android SDK link from https://developer.android.com/studio/#downloads

    ```bash
    export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
    ```
    ○ → sdkmanager --sdk_root=${ANDROID_HOME} "tools"

    https://gist.github.com/fedme/fd42caec2e5a7e93e12943376373b7d0
    Used a combinaton of these gists:
    https://gist.github.com/fedme/fd42caec2e5a7e93e12943376373b7d0
    https://gist.github.com/jjvillavicencio/18feb09f0e93e017a861678bc638dcb0
  14. @steveclarke steveclarke revised this gist May 9, 2020. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions Install Android SDK CLI Ubuntu 20.04 WSL2.md
    Original file line number Diff line number Diff line change
    @@ -25,3 +25,5 @@ Set `JAVA_HOME`. Add the following to `~/.bashrc`
    ```bash
    export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
    ```

    https://gist.github.com/fedme/fd42caec2e5a7e93e12943376373b7d0
  15. @steveclarke steveclarke renamed this gist May 9, 2020. 1 changed file with 0 additions and 0 deletions.
  16. @steveclarke steveclarke revised this gist May 9, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Install Android SDK CLI Ubuntu 20.04 WSL2
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Install Android SDK CLI
    # Install Android SDK CLI (Work in Progress)

    ```bash
    sudo apt install android-sdk
  17. @steveclarke steveclarke created this gist May 9, 2020.
    27 changes: 27 additions & 0 deletions Install Android SDK CLI Ubuntu 20.04 WSL2
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    # Install Android SDK CLI

    ```bash
    sudo apt install android-sdk
    ```

    Installs to `/usr/lib/android-sdk`


    ## Install Java 8

    ```bash
    sudo apt install openjdk-8-jdk
    ```

    Set default `java` and `javac` to v8

    ```bash
    sudo update-alternatives --config java
    sudo update-alternatives --config javac
    ```

    Set `JAVA_HOME`. Add the following to `~/.bashrc`

    ```bash
    export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
    ```