Skip to content

Instantly share code, notes, and snippets.

@yaochx
Created August 13, 2020 11:56
Show Gist options
  • Save yaochx/370e57cd483680c97c80a1ea497ab796 to your computer and use it in GitHub Desktop.
Save yaochx/370e57cd483680c97c80a1ea497ab796 to your computer and use it in GitHub Desktop.
install android tools in windows subsystem linux
cd ~
sudo apt-get install unzip
wget https://dl.google.com/android/repository/commandlinetools-linux-6609375_latest.zip
unzip commandlinetools-linux-6609375_latest.zip -d Android
rm commandlinetools-linux-6609375_latest.zip
sudo apt-get install -y lib32z1 openjdk-8-jdk-headless
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH="$PATH:$JAVA_HOME/bin"
printf "\n\nexport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64\nexport PATH=\"\$PATH:\$JAVA_HOME/bin\"" >> ~/.bashrc
cd Android/tools/bin
./sdkmanager "platform-tools" "platforms;android-21" "build-tools;30.0.1"
export ANDROID_HOME=/home/<user>/Android
export PATH="$PATH:$ANDROID_HOME/tools"
export PATH="$PATH:$ANDROID_HOME/platform-tools"
printf "\n\nexport ANDROID_HOME=/home/<user>/Android\nexport PATH=\"\$PATH:\$ANDROID_HOME/tools\"\nexport PATH=\"\$PATH:\$ANDROID_HOME/platform-tools\"" >> ~/.bashrc
./sdkmanager --update
sudo apt-get install gradle
gradle -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment