From 40b493649b06a2577fcf535ae2ec674b95b9b51e Mon Sep 17 00:00:00 2001 From: Simo Kinnunen Date: Thu, 17 Apr 2014 17:33:40 +0900 Subject: [PATCH] Prevent certificate issues when installing STFService by uninstalling it first. --- lib/roles/device/resources/service.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/roles/device/resources/service.js b/lib/roles/device/resources/service.js index 6220682d..9b009452 100644 --- a/lib/roles/device/resources/service.js +++ b/lib/roles/device/resources/service.js @@ -69,10 +69,15 @@ module.exports = syrup.serial() }) .catch(function() { log.info('Installing STFService') - return promiseutil.periodicNotify( - adb.install(options.serial, resource.apk) - , 10000 - ) + // Uninstall first to make sure we don't have any certificate + // issues. + return adb.uninstall(options.serial, resource.pkg) + .then(function() { + return promiseutil.periodicNotify( + adb.install(options.serial, resource.apk) + , 10000 + ) + }) .progressed(function() { log.warn( 'STFService installation is taking a long time; '