mirror of
https://github.com/appium/appium.git
synced 2026-05-01 07:51:30 -05:00
Added timeout to uninstallApk
This commit is contained in:
@@ -131,13 +131,18 @@ ADB.prototype.checkAaptPresent = function (cb) {
|
||||
this.checkSdkBinaryPresent("aapt", cb);
|
||||
};
|
||||
|
||||
ADB.prototype.exec = function (cmd, cb) {
|
||||
ADB.prototype.exec = function (cmd, opts, cb) {
|
||||
if (!cb && typeof opts === 'function') {
|
||||
cb = opts;
|
||||
opts = {};
|
||||
}
|
||||
if (!cmd) {
|
||||
return cb(new Error("You need to pass in a command to exec()"));
|
||||
}
|
||||
cmd = this.adbCmd + ' ' + cmd;
|
||||
logger.debug("executing: " + cmd);
|
||||
exec(cmd, {maxBuffer: 524288}, function (err, stdout, stderr) {
|
||||
opts = _.defaults(opts, {maxBuffer: 524288});
|
||||
exec(cmd, opts, function (err, stdout, stderr) {
|
||||
if (err) logger.warn(err);
|
||||
cb(err, stdout, stderr);
|
||||
});
|
||||
@@ -1064,7 +1069,7 @@ ADB.prototype.waitForNotActivity = function (pkg, act, waitMs, cb) {
|
||||
|
||||
ADB.prototype.uninstallApk = function (pkg, cb) {
|
||||
logger.info("Uninstalling " + pkg);
|
||||
this.exec("uninstall " + pkg, function (err, stdout) {
|
||||
this.exec("uninstall " + pkg, {timeout: 20000}, function (err, stdout) {
|
||||
if (err) {
|
||||
logger.error(err);
|
||||
cb(err);
|
||||
|
||||
Reference in New Issue
Block a user