Launcher

object Launcher

Functions

Link copied to clipboard

Returns all applications and their foreground state using the am stack list command.

Link copied to clipboard
fun foreground(uiAutomation: UiAutomation, packageName: String): Boolean

Checks if the app with the given packageName is in the foreground, re-using the applications function.

Link copied to clipboard
fun installed(uiAutomation: UiAutomation, targetContext: Context, packageName: String): Boolean

Checks if the app with the given packageName is installed, according to launch intent retrieved by package manager.

Link copied to clipboard
fun label(instrumentation: Instrumentation, uiAutomation: UiAutomation, packageName: String): String?

Returns the application label of the given package

Link copied to clipboard
fun launch(instrumentation: Instrumentation, uiAutomation: UiAutomation, device: UiDevice, packageName: String, timeout: Long = 10000)

Launches the app with the given packageName if it's not running

Link copied to clipboard
fun running(uiAutomation: UiAutomation, packageName: String): Boolean

Checks if the app with the given packageName is running, re-using the applications function.