Skip to main content

On This Page

Setup Expo Build Environment on WSL2 (Without Android Studio nor Paying Expo Credits)

2 min read
Share

These articles are AI-generated summaries. Please check the original sources for full details.

Setup Expo Build Environment on WSL2 (Without Android Studio nor Paying Expo Credits)

A developer reduced Android SDK bloat from 30 GB to 3 GB by installing only required components for local Expo builds, eliminating reliance on Android Studio and Expo Cloud credits.

Why This Matters

Expo Cloud Builds incur costs after a small free quota, but local builds offer unlimited free iterations. However, Android Studio’s 30 GB footprint includes unnecessary tools. By installing only the command-line SDK, build-tools, and NDK, developers achieve a lean environment that mirrors Expo’s CI setup, reducing resource overhead and build costs.

Key Insights

  • “3 GB Android SDK install (2025)”
  • “Node 20.19.4 for Expo CI alignment”
  • “Maestro and Bundletool used for local testing”

Working Example

# Base dependencies
sudo apt update
sudo apt install -y build-essential git unzip zip curl wget ca-certificates openjdk-17-jdk
# Install Node 20.19.4 with NVM
export NVM_DIR="$HOME/.nvm"
if [ ! -d "$NVM_DIR" ]; then
  curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
fi
source "$NVM_DIR/nvm.sh"
nvm install 20.19.4
nvm alias default 20.19.4
# Android SDK minimal install
export ANDROID_HOME="$HOME/Android/Sdk"
mkdir -p "$ANDROID_HOME"
cd /tmp
wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -O cmdtools.zip
mkdir -p "$ANDROID_HOME/cmdline-tools"
unzip -q cmdtools.zip -d "$ANDROID_HOME/cmdline-tools"
mv "$ANDROID_HOME/cmdline-tools/cmdline-tools" "$ANDROID_HOME/cmdline-tools/tools"
# Accept licenses and install core packages
yes | sdkmanager --licenses
sdkmanager "platform-tools" \
"platforms;android-35" \
"build-tools;35.0.0" \
"build-tools;29.0.3" \
"ndk;27.1.12297006" \
"extras;google;m2repository" \
"extras;android;m2repository"

Practical Applications

  • Use Case: Local Expo builds for rapid iteration without Android Studio
  • Pitfall: Missing build-tools versions can cause APK signing failures

References:

Continue reading

Next article

Simplicity in Product Design: Accelerating Development and Scaling

Related Content