Last active
November 27, 2025 08:57
-
Star
(294)
You must be signed in to star a gist -
Fork
(82)
You must be signed in to fork a gist
-
-
Save jjvillavicencio/18feb09f0e93e017a861678bc638dcb0 to your computer and use it in GitHub Desktop.
Install Android SDK on Windows Bash (WSL)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd /home/<user>/ | |
| sudo apt-get install unzip | |
| wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip | |
| unzip sdk-tools-linux-4333796.zip -d Android | |
| rm sdk-tools-linux-4333796.zip | |
| sudo apt-get install -y lib32z1 openjdk-8-jdk | |
| 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-26" "build-tools;26.0.3" | |
| 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 | |
| android update sdk --no-ui | |
| sudo apt-get install gradle | |
| gradle -v | |
| adb start-server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@qalqi
Thanks.
Here is my setup on WSL2 Arch. I need to change few more settings
React Native + Expo on WSL2 — Arch
Install Android SDK Command-line Tools
android-sdk-cmdline-tools-latest,jdkand optional dependencies (Arch Linux example):Confirm installation:
Configure Environment Variables in WSL2
Add the following to
~/.zshrcor~/.bashrc:Apply changes:
Set permissions for Android SDK directory:
Accept SDK licenses and install packages
Verify installation:
adb version ls $ANDROID_HOME/platformsConnect your phone via USB (initial setup)
Enable Developer Options → USB debugging on your phone.
Connect via USB. Set phone to Transferring files (MTP).
Setup Metro bundler for LAN access
Find Windows host IP on Wi-Fi:
Find WSL2 IP:
Forward port 8081 from Windows → WSL2:
Allow port 8081 through Windows firewall:
Enable ADB over Wi-Fi
Find your phone’s Wi-Fi IP:
Settings → Connections → Wi-Fi → gear icon → Advanced → IP address
Connect via Wi-Fi:
Phone is now connected over Wi-Fi.
Create and start a React Native / Expo project
Metro should show: