diff --git a/lib/roles/device/resources/remote.js b/lib/roles/device/resources/remote.js index ce835ed1..904fdfb9 100644 --- a/lib/roles/device/resources/remote.js +++ b/lib/roles/device/resources/remote.js @@ -34,6 +34,14 @@ module.exports = syrup() } } + function removeResource(res) { + return adb.shell(options.serial, ['rm', res.dest]) + .then(function(out) { + return streamutil.readAll(out) + }) + .return(res) + } + function installResource(res) { return adb.push(options.serial, res.src, res.dest, res.mode) .then(function(transfer) { @@ -65,8 +73,8 @@ module.exports = syrup() function installAll() { return Promise.all([ - installResource(resources.bin).then(ensureNotBusy) - , installResource(resources.lib) + removeResource(resources.bin).then(installResource).then(ensureNotBusy) + , removeResource(resources.lib).then(installResource) ]) }