You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Widget not placed in automated screenshot (UIAutomator drag silently no-ops) #5
The screenshot CI workflow (feature/real-screenshots) goes green and produces fastlane/metadata/android/en-US/images/phoneScreenshots/01_widget.png, but the captured image shows a bare home screen with no widget on it.
Root cause
WidgetScreenshotTest.placeWidget() uses UIAutomator2 selectors that find something in the Launcher3 widget picker but don't actually land the widget on the home screen. The instrumentation exits 0 because no error() call is reached (the selectors succeed individually), but the drag either targets the wrong element or drops it outside the home grid.
Likely causes:
By.res("com.android.launcher3:id/workspace") may resolve to the outer container, making the long-click land on a wrong target (or open the app drawer instead of the widget picker)
By.textContains("Debug Mode") in the widget picker may match the app header label but not the actual draggable widget preview tile
The drag destination (displayWidth/2, displayHeight/4) may be outside the safe drop zone of the grid
Fix direction
Dump the UI hierarchy (uiautomator dump) during the widget picker step to identify the correct resource IDs and class names for API 33 Launcher3
Use By.clazz("android.widget.TextView").text("Widgets") or By.res("com.android.launcher3:id/widget_button") for the picker trigger
For the widget tile, use the exact resource ID of the draggable preview cell in the picker
After the drag, assert that a view with package info.yuryv.androiddebugmode is present on the home screen before taking the screenshot
Related
Branch: feature/real-screenshots
Workflow: .github/workflows/screenshots.yml
Test class: app/src/androidTest/java/info/yuryv/androiddebugmode/screenshot/WidgetScreenshotTest.kt
Fixed by #6. The root causes were: (1) the UIAutomator2 selector used uppercase 'Widget' but Launcher3 uses lowercase 'widget' in the content description, so the wrong view was being dragged; (2) once the correct WidgetCell was found, the drop coordinates needed to be at the vertical centre of the screen (y=displayHeight/2) to land in an empty grid cell rather than conflicting with the search bar area.
Activity
digitalby commentedon Apr 6, 2026
Fixed by #6. The root causes were: (1) the UIAutomator2 selector used uppercase 'Widget' but Launcher3 uses lowercase 'widget' in the content description, so the wrong view was being dragged; (2) once the correct WidgetCell was found, the drop coordinates needed to be at the vertical centre of the screen (y=displayHeight/2) to land in an empty grid cell rather than conflicting with the search bar area.