UI Automator is a UI testing framework suitable for cross-app functional UI testing across system and installed apps.

The documentation for UI Automator is in developers.android.com.