Ejemplo n.º 1
0
def is_app_running(package_name):
    """Is an app with 'package_name' currently running on the device?"""

    p = subprocess.Popen([adb_path(), 'shell', 'ps'], shell=False,
                         stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    output = p.communicate()[0]
    return package_name in output
Ejemplo n.º 2
0
def is_app_running(package_name):
    """Is an app with 'package_name' currently running on the device?"""

    p = subprocess.Popen([adb_path(), 'shell', 'ps'],
                         shell=False,
                         stdout=subprocess.PIPE,
                         stderr=subprocess.PIPE)
    output = p.communicate()[0]
    return package_name in output
Ejemplo n.º 3
0
def stop_app(package_name):
    """Stop the app with 'package_name on the device.'"""

    cmd = [adb_path(), "shell", "am", "force-stop", package_name]
    subprocess.call(cmd)
Ejemplo n.º 4
0
def stop_app(package_name):
    """Stop the app with 'package_name on the device.'"""

    cmd = [adb_path(), "shell", "am", "force-stop", package_name]
    subprocess.call(cmd)