Skip to content

Windows Android Testing Setup Guide ​

Step-by-step guide for setting up Android E2E testing on Windows with console error capture.

Prerequisites ​

  • Windows 10 or Windows 11
  • WSL2 installed (already available if running the DevContainer)
  • At least 8 GB RAM (16 GB recommended for emulator performance)

Step 1: Install Android Studio ​

  1. Download Android Studio from https://developer.android.com/studio
  2. Run the installer. During setup, check "Android Virtual Device"
  3. After installation, open Android Studio and go to File > Settings > Languages & Frameworks > Android SDK
  4. In the SDK Platforms tab:
    • Check "Android 14 (API 34)"
  5. In the SDK Tools tab, check:
    • "Android SDK Command-line Tools"
    • "Android Emulator"
    • "Android SDK Platform-Tools"
  6. Click Apply and wait for downloads to finish

Add SDK to PATH ​

Open PowerShell and add the following to your profile (or run for the current session):

powershell
$env:PATH += ";$env:LOCALAPPDATA\Android\Sdk\platform-tools;$env:LOCALAPPDATA\Android\Sdk\emulator"

To make it permanent, add the line to your PowerShell profile:

powershell
notepad $PROFILE
# Add the line above, save, and restart PowerShell

Verify the installation:

powershell
adb version
emulator -list-avds

Step 2: Create a Virtual Device ​

  1. In Android Studio, go to Tools > Device Manager
  2. Click Create Virtual Device
  3. Select "Pixel 7" and click Next
  4. Select "UpsideDownCake" (API 34)
    • Click Download if the system image is not yet available
  5. Click Next, then Finish
  6. Click the play button to start the emulator

Verify the emulator is running:

powershell
adb devices
# Should show: emulator-5554   device

Step 3: Install Maestro CLI ​

Option A: PowerShell (Windows native) ​

powershell
iwr -useb "https://get.maestro.mobile.dev" | iex

Option B: WSL / DevContainer ​

bash
curl -Ls "https://get.maestro.mobile.dev" | bash

Verify the installation:

bash
maestro --version

Step 4: Build & Install the PPP Development APK ​

From the DevContainer terminal:

bash
cd mobile/ppp
npx expo run:android --variant release
# This creates an APK in the build output directory

Install the APK on the emulator from Windows PowerShell (with ADB in PATH):

powershell
adb install path\to\app.apk

Or from WSL if ADB is available:

bash
adb install path/to/app.apk

Step 5: Run E2E Tests with Console Capture ​

Open two terminal windows:

Terminal 1: Start logcat capture ​

This catches all errors including WebView/Chromium console output:

bash
adb logcat -c  # Clear existing logs
adb logcat -v time '*:E' 'chromium:V' > test-results/console-errors.log &

Terminal 2: Run Maestro tests ​

bash
maestro test \
  -e TEST_EMAIL="e2e-ppp-consultant@ppp-test.local" \
  -e TEST_PASSWORD="E2eTest123!@" \
  --debug-output ./test-results \
  e2e/

After tests complete, stop logcat:

bash
kill %1

Or use the convenience script that handles both automatically:

bash
bash e2e/run-with-console-capture.sh

Step 6: Review Results ​

After the test run completes, check the following:

ArtifactLocation
Screenshots./test-results/screenshots/
Console errors./test-results/console-errors.log
Maestro logs./test-results/maestro-*.log

Troubleshooting ​

"Device not found" ​

Run adb devices to check if the emulator is listed. It should appear as emulator-5554. If not:

  • Make sure the emulator is running in Android Studio
  • Restart the ADB server: adb kill-server && adb start-server

"App crashes on launch" ​

  • Use a development build, not Expo Go. Expo Go does not support custom native modules
  • Rebuild the APK: npx expo run:android --variant release

"WebView blank" ​

  • Check the API URL in app.config.js points to a reachable backend
  • If running against a local backend, make sure the emulator can reach it (use 10.0.2.2 instead of localhost from the emulator)

KVM not available / Emulator slow ​

  • Enable VT-x (Intel) or AMD-V (AMD) in your BIOS/UEFI settings for hardware-accelerated emulation
  • Without hardware acceleration, the emulator will be extremely slow

ADB not found in WSL ​

If you need ADB inside WSL to communicate with a Windows-hosted emulator, you can either:

  1. Install Android SDK inside WSL separately
  2. Use the Windows ADB binary via interop: "/mnt/c/Users/<you>/AppData/Local/Android/Sdk/platform-tools/adb.exe" devices

Internal documentation — org members only