Skip to content

Commit 654a34e

Browse files
committed
Only try to kill uiautomator when poco fails to start
(cherry picked from commit 92ae66e65e085f1b4e78232975727dd9764ee3a7)
1 parent c993fcd commit 654a34e

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

poco/drivers/android/uiautomation.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,6 @@ def __init__(self, device=None, using_proxy=True, force_restart=False, use_airte
181181
p1 = 10081
182182

183183
# start
184-
if self._is_running('com.github.uiautomator'):
185-
warnings.warn('{} should not run together with "uiautomator". "uiautomator" will be killed.'
186-
.format(self.__class__.__name__))
187-
self.adb_client.shell(['am', 'force-stop', 'com.github.uiautomator'])
188-
189184
ready = self._start_instrument(p0, force_restart=force_restart)
190185
if not ready:
191186
# 之前启动失败就卸载重装,现在改为尝试kill进程或卸载uiautomator
@@ -250,7 +245,7 @@ def _start_instrument(self, port_to_ping, force_restart=False):
250245
self._instrument_proc = None
251246

252247
ready = False
253-
self.adb_client.shell(['am', 'force-stop', PocoServicePackage])
248+
# self.adb_client.shell(['am', 'force-stop', PocoServicePackage])
254249

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

0 commit comments

Comments
 (0)