From dc6e39e3514ebca52d227adb12cf134b95e72d57 Mon Sep 17 00:00:00 2001 From: Laurent Sansonetti Date: Wed, 26 Mar 2014 17:44:11 +0100 Subject: [PATCH] =?UTF-8?q?don=E2=80=99t=20try=20to=20force-kill=20the=20a?= =?UTF-8?q?pp=20if=20it=E2=80=99s=20already=20dead?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/motion/project/template/android.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/motion/project/template/android.rb b/lib/motion/project/template/android.rb index bcb1ba34..68e19d13 100644 --- a/lib/motion/project/template/android.rb +++ b/lib/motion/project/template/android.rb @@ -296,7 +296,9 @@ def run_apk(mode) sh line Signal.trap('INT') do # Kill the app on ^C. - sh "\"#{adb_path}\" #{adb_mode_flag(mode)} shell am force-stop #{App.config.package}" + if `\"#{adb_path}\" -d shell ps`.include?(App.config.package) + sh "\"#{adb_path}\" #{adb_mode_flag(mode)} shell am force-stop #{App.config.package}" + end exit 0 end # Show logs.