Skip to content

Commit 38307d1

Browse files
authored
fix: detection if emualtor booted (#61)
For some reason mFocusedApp sometime returns nothing.
1 parent d1d4b4c commit 38307d1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

core/utils/device/adb.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import logging
22
import os
3-
43
import time
54

65
from core.enums.os_type import OSType
@@ -61,11 +60,11 @@ def is_running(device_id):
6160
:return: True if running, False if not running.
6261
"""
6362
if Settings.HOST_OS is OSType.WINDOWS:
64-
command = "shell dumpsys window windows | findstr mFocusedApp"
63+
command = "shell dumpsys window windows | findstr mCurrentFocus"
6564
else:
66-
command = "shell dumpsys window windows | grep -E 'mFocusedApp'"
65+
command = "shell dumpsys window windows | grep -E 'mCurrentFocus'"
6766
result = Adb.__run_adb_command(command=command, device_id=device_id, timeout=10, fail_safe=True)
68-
return bool('ActivityRecord' in result.output)
67+
return bool('Window' in result.output)
6968

7069
@staticmethod
7170
def wait_until_boot(device_id, timeout=180, check_interval=3):

0 commit comments

Comments
 (0)