running

fun running(instrumentation: Instrumentation, packageName: String): Boolean

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

The -s argument limits the output to one pid

Return

True if app is running

Parameters

instrumentation

The instrumentation used for automated testing

packageName

The package of the app