Merge pull request #2654 from bootstraponline/uninstall_fix

uninstall before install
This commit is contained in:
Jonah
2014-05-23 12:03:49 -07:00

View File

@@ -460,12 +460,12 @@ androidCommon.installApp = function (cb) {
};
androidCommon.installRemoteWithRetry = function (remoteApk, cb) {
this.adb.installRemote(remoteApk, function (err) {
if (err) {
logger.warn("Installing remote apk failed, going to uninstall and try " +
"again");
this.adb.uninstallApk(this.args.appPackage, function (err) {
if (err) logger.warn("Uninstalling apk failed, continuing");
this.adb.uninstallApk(this.args.appPackage, function (err) {
if (err) logger.warn("Uninstalling apk failed, continuing");
this.adb.installRemote(remoteApk, function (err) {
if (err) {
logger.warn("Installing remote apk failed, going to uninstall and try " +
"again");
this.removeTempApks([], function () {
this.adb.push(this.args.app, remoteApk, function (err) {
if (err) return cb(err);
@@ -473,10 +473,10 @@ androidCommon.installRemoteWithRetry = function (remoteApk, cb) {
this.adb.installRemote(remoteApk, cb);
}.bind(this));
}.bind(this));
}.bind(this));
} else {
cb();
}
} else {
cb();
}
}.bind(this));
}.bind(this));
};