Build and install
- Use
npm run android:buildfor build smoke. - Use
npm run android:installwhen the target AVD does not already have DDG installed. - If an emulator restart loses the install but the APK exists, reinstall with:
adb install -r android/app/build/outputs/apk/internal/debug/<apk-name>
Emulator
- Default to
ddg_pixel9_api35as a known-good AVD. - Start headlessly with explicit software GPU rendering:
emulator -avd ddg_pixel9_api35 -no-window -no-snapshot-save -no-boot-anim -gpu swiftshader
If the emulator crashes, disappears from ADB, or fails to capture screenshots, retry once with:
emulator -avd ddg_pixel9_api35 -no-window -no-snapshot-save -no-boot-anim -gpu lavapipe
Record the GPU mode used in the required output. Keep the proxy, URL, app package, and screenshot workflow unchanged between attempts.
ADB reliability
- Wrap long or failure-prone ADB calls with
timeout, especiallyscreencap,dumpsys,uiautomator, and clean upadb shellcommands. - If a retry starts another AVD, use explicit serial targeting for all later commands:
adb -s <serial> ...
Load URL
Use the debug package explicitly:
adb shell am start -W -a android.intent.action.VIEW -d '<url>' com.duckduckgo.mobile.android.debug
Screenshots
Prefer device-file screenshots; avoid adb exec-out screencap -p because it may hang.
adb shell screencap -p /sdcard/screenshot_initial.png
adb pull /sdcard/screenshot_initial.png /opt/cursor/artifacts/<dir>/screenshot_initial.png
System UI recovery
If screenshots are blocked by Application Not Responding: com.google.android.apps.nexuslauncher, verify DDG is foreground/responsive first.
adb shell input keyevent BACK
adb shell am force-stop com.google.android.apps.nexuslauncher
Then relaunch the URL activity and report the cleanup in the required output.
Runtime configuration cleanup
- Remove
/data/local/tmp/webview-command-linefrom every AVD touched - Force-stop DDG, then stop emulators