OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Provides an interface to communicate with the device via the adb command. | 5 """Provides an interface to communicate with the device via the adb command. |
6 | 6 |
7 Assumes adb binary is currently on system path. | 7 Assumes adb binary is currently on system path. |
8 """ | 8 """ |
9 | 9 |
10 import collections | 10 import collections |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 """Android version of killall, connected via adb. | 518 """Android version of killall, connected via adb. |
519 | 519 |
520 Args: | 520 Args: |
521 process: name of the process to kill off | 521 process: name of the process to kill off |
522 | 522 |
523 Returns: | 523 Returns: |
524 the number of processes killed | 524 the number of processes killed |
525 """ | 525 """ |
526 pids = self.ExtractPid(process) | 526 pids = self.ExtractPid(process) |
527 if pids: | 527 if pids: |
528 self.RunShellCommand('kill ' + ' '.join(pids)) | 528 self.RunShellCommand('kill -9 ' + ' '.join(pids)) |
529 return len(pids) | 529 return len(pids) |
530 | 530 |
531 def KillAllBlocking(self, process, timeout_sec): | 531 def KillAllBlocking(self, process, timeout_sec): |
532 """Blocking version of killall, connected via adb. | 532 """Blocking version of killall, connected via adb. |
533 | 533 |
534 This waits until no process matching the corresponding name appears in ps' | 534 This waits until no process matching the corresponding name appears in ps' |
535 output anymore. | 535 output anymore. |
536 | 536 |
537 Args: | 537 Args: |
538 process: name of the process to kill off | 538 process: name of the process to kill off |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1289 """ | 1289 """ |
1290 def __init__(self, output): | 1290 def __init__(self, output): |
1291 self._output = output | 1291 self._output = output |
1292 | 1292 |
1293 def write(self, data): | 1293 def write(self, data): |
1294 data = data.replace('\r\r\n', '\n') | 1294 data = data.replace('\r\r\n', '\n') |
1295 self._output.write(data) | 1295 self._output.write(data) |
1296 | 1296 |
1297 def flush(self): | 1297 def flush(self): |
1298 self._output.flush() | 1298 self._output.flush() |
OLD | NEW |