From 66975384ff9fab89f73479116b4829d075fe7e83 Mon Sep 17 00:00:00 2001 From: Konstantinos Xynos Date: Fri, 29 Jan 2021 22:47:09 +0100 Subject: [PATCH] Added another way to get the pid, when get_applications() returns nothing. There are instances where device.enumerate_applications() returns nothing. It is possible to get the process via just the name. --- dump.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dump.py b/dump.py index 7a7bf32..7934751 100755 --- a/dump.py +++ b/dump.py @@ -262,8 +262,11 @@ def open_target_app(device, name_or_bundleid): pid = application.pid display_name = application.name bundle_identifier = application.identifier - + try: + if pid == '' : + pid = device.get_process(name_or_bundleid).pid + if not pid: pid = device.spawn([bundle_identifier]) session = device.attach(pid)