diff --git a/lib/units/device/plugins/install.js b/lib/units/device/plugins/install.js index ca398f9b..3592e657 100644 --- a/lib/units/device/plugins/install.js +++ b/lib/units/device/plugins/install.js @@ -97,7 +97,7 @@ module.exports = syrup.serial() sendProgress('installing_app', guesstimate) return promiseutil.periodicNotify( adb.installRemote(options.serial, apk) - .timeout(60000) + .timeout(120000) .catch(function(err) { switch (err.code) { case 'INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES': @@ -109,7 +109,7 @@ module.exports = syrup.serial() .timeout(15000) .then(function() { return adb.installRemote(options.serial, apk) - .timeout(60000) + .timeout(120000) }) default: return Promise.reject(err) @@ -147,7 +147,7 @@ module.exports = syrup.serial() // Progress 90% sendProgress('launching_app', 90) return adb.startActivity(options.serial, launchActivity) - .timeout(15000) + .timeout(30000) } } }) @@ -157,11 +157,22 @@ module.exports = syrup.serial() , reply.okay('success') ]) }) - .catch(function(err) { + .catch(Promise.TimeoutError, function(err) { log.error('Installation of package "%s" failed', pkg, err.stack) push.send([ channel - , reply.fail('fail') + , reply.fail('timeout') + ]) + }) + .catch(function(err) { + log.error('Installation of package "%s" failed', pkg, err.stack) + // The error codes are available at https://github.com/android/ + // platform_frameworks_base/blob/master/core/java/android/content/ + // pm/PackageManager.java, although this could be some other + // error as well. + push.send([ + channel + , reply.fail(err.code || 'fail') ]) }) })