What problem does it solve?
This skill solves the challenge of reliably driving cross-process Android UI flows—like Settings, system notifications, and another app’s screens—from instrumentation tests when Espresso can’t interact across foreign windows.
Core Features & Use Cases
- Cross-app/system UI control with UiAutomator 2.3.0: Use
UiDevice global actions (home, back, recents, notifications, quick settings) and interact with UI nodes across package boundaries.
- Modern selector-based element targeting: Use
BySelector with By factory methods to resolve UiObject2 elements using BySelector criteria.
- Robustness for real device flakiness: Handle
findObject returning null, prefer device.wait(Until...), and recover from StaleObjectException by re-finding after transitions or UI refreshes.
- Safer launch strategy for foreign packages: Prefer
Context.startActivity plus <queries> on API 30+, while documenting the discouraged executeShellCommand path.
- Use cases: Turn Wi‑Fi on/off via Settings, dismiss the notification shade, test a share/contact picker flow that spans the app under test and another activity.
Quick Start
Use cross-app-tests-with-uiautomator to launch Settings from an instrumentation test, wait until the target Settings package appears, and then click a specific Settings screen element using a By selector.