don’t try to force-kill the app if it’s already dead

This commit is contained in:
Laurent Sansonetti
2014-03-26 17:44:11 +01:00
parent 2170e6098d
commit dc6e39e351

View File

@@ -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.