def adb_pidof_app(emulator: Emulator, apk: Apk):
'''
returns PID of running apk
'''
try:
result = subprocess.check_output(
[config.adb, '-s', 'emulator-' + emulator.port, 'shell', 'pidof', apk.package_name])
result = result.decode().split('\n')[0]
util.debug_print(result, flag=PRINT_FLAG)
return result
except subprocess.SubprocessError:
print("maybe not found/uninstalled already")
评论列表
文章目录