Skip to content

Commit

Permalink
Only try to kill uiautomator when poco fails to start
Browse files Browse the repository at this point in the history
(cherry picked from commit 92ae66e65e085f1b4e78232975727dd9764ee3a7)
  • Loading branch information
yimelia committed Nov 23, 2021
1 parent c993fcd commit 654a34e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions poco/drivers/android/uiautomation.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,6 @@ def __init__(self, device=None, using_proxy=True, force_restart=False, use_airte
p1 = 10081

# start
if self._is_running('com.github.uiautomator'):
warnings.warn('{} should not run together with "uiautomator". "uiautomator" will be killed.'
.format(self.__class__.__name__))
self.adb_client.shell(['am', 'force-stop', 'com.github.uiautomator'])

ready = self._start_instrument(p0, force_restart=force_restart)
if not ready:
# 之前启动失败就卸载重装,现在改为尝试kill进程或卸载uiautomator
Expand Down Expand Up @@ -250,7 +245,7 @@ def _start_instrument(self, port_to_ping, force_restart=False):
self._instrument_proc = None

ready = False
self.adb_client.shell(['am', 'force-stop', PocoServicePackage])
# self.adb_client.shell(['am', 'force-stop', PocoServicePackage])

# 启动instrument之前,先把主类activity启动起来,不然instrumentation可能失败
self.adb_client.shell('am start -n {}/.TestActivity'.format(PocoServicePackage))
Expand Down

0 comments on commit 654a34e

Please sign in to comment.