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
- Download Android Studio from https://developer.android.com/studio
- Run the installer. During setup, check "Android Virtual Device"
- After installation, open Android Studio and go to File > Settings > Languages & Frameworks > Android SDK
- In the SDK Platforms tab:
- Check "Android 14 (API 34)"
- In the SDK Tools tab, check:
- "Android SDK Command-line Tools"
- "Android Emulator"
- "Android SDK Platform-Tools"
- 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):
$env:PATH += ";$env:LOCALAPPDATA\Android\Sdk\platform-tools;$env:LOCALAPPDATA\Android\Sdk\emulator"To make it permanent, add the line to your PowerShell profile:
notepad $PROFILE
# Add the line above, save, and restart PowerShellVerify the installation:
adb version
emulator -list-avdsStep 2: Create a Virtual Device
- In Android Studio, go to Tools > Device Manager
- Click Create Virtual Device
- Select "Pixel 7" and click Next
- Select "UpsideDownCake" (API 34)
- Click Download if the system image is not yet available
- Click Next, then Finish
- Click the play button to start the emulator
Verify the emulator is running:
adb devices
# Should show: emulator-5554 deviceStep 3: Install Maestro CLI
Option A: PowerShell (Windows native)
iwr -useb "https://get.maestro.mobile.dev" | iexOption B: WSL / DevContainer
curl -Ls "https://get.maestro.mobile.dev" | bashVerify the installation:
maestro --versionStep 4: Build & Install the PPP Development APK
From the DevContainer terminal:
cd mobile/ppp
npx expo run:android --variant release
# This creates an APK in the build output directoryInstall the APK on the emulator from Windows PowerShell (with ADB in PATH):
adb install path\to\app.apkOr from WSL if ADB is available:
adb install path/to/app.apkStep 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:
adb logcat -c # Clear existing logs
adb logcat -v time '*:E' 'chromium:V' > test-results/console-errors.log &Terminal 2: Run Maestro tests
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:
kill %1Or use the convenience script that handles both automatically:
bash e2e/run-with-console-capture.shStep 6: Review Results
After the test run completes, check the following:
| Artifact | Location |
|---|---|
| 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.jspoints to a reachable backend - If running against a local backend, make sure the emulator can reach it (use
10.0.2.2instead oflocalhostfrom 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:
- Install Android SDK inside WSL separately
- Use the Windows ADB binary via interop:
"/mnt/c/Users/<you>/AppData/Local/Android/Sdk/platform-tools/adb.exe" devices