Launcher

object Launcher

Functions

Link copied to clipboard
fun execute(instrumentation: Instrumentation, command: String): String

Helper method to execute a command using uiAutomation

Link copied to clipboard
fun foreground(instrumentation: Instrumentation, packageName: String): Boolean

Checks if the app with the given packageName is in the foreground, using the adb shell dumpsys activity activities command.

Link copied to clipboard
fun installed(instrumentation: Instrumentation, 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 launch(instrumentation: Instrumentation, packageName: String, timeout: Long = 5000)

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

Link copied to clipboard
fun running(instrumentation: Instrumentation, packageName: String): Boolean

Checks if the app with the given packageName is running, according to adb shell pidof -s <package>