Skip to content

Commit 1aa303a

Browse files
authored
Merge pull request #360 from js361014/stop-app
Added stopping app
2 parents e257248 + 66b9e51 commit 1aa303a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

AppiumLibrary/keywords/_applicationmanagement.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,19 @@ def activate_app(self, app_id):
281281
"""
282282
self._current_application().activate_app(app_id)
283283

284+
def stop_app(self, app_id, timeout=5000, include_stderr=True):
285+
"""
286+
Stop the given app on the device
287+
288+
Android only.
289+
"""
290+
self._current_application().execute_script('mobile: shell', {
291+
'command': 'am force-stop',
292+
'args': [app_id],
293+
'includeStderr': include_stderr,
294+
'timeout': timeout
295+
})
296+
284297
def touch_id(self, match=True):
285298
"""
286299
Simulate Touch ID on iOS Simulator

0 commit comments

Comments
 (0)