use ubuntu-app-stop to stop the app more cleanly
(cherry picked from commit bc919c100e4bd89be12b8be141d7f1d7e4dbce40)
diff --git a/bin/templates/project/cordova/lib/run.js b/bin/templates/project/cordova/lib/run.js
index ba622a7..6373639 100644
--- a/bin/templates/project/cordova/lib/run.js
+++ b/bin/templates/project/cordova/lib/run.js
@@ -143,9 +143,9 @@
assert.ok(names.length == 1);
- logger.info('Killing application if already running on your device.');
+ logger.info('Stopping application if needed.');
- Devices.adbExec(target, 'shell "ps -A -eo pid,cmd | grep cordova-ubuntu | awk \'{ print \\$1 }\' | xargs kill -9"');
+ Devices.adbExec(target, 'shell "ubuntu-app-stop \\`ubuntu-app-triplet ' + appId + '\\`"');
if (debug)
Devices.adbExec(target, 'forward --remove-all');