mirror of
https://github.com/appium/appium.git
synced 2026-02-12 04:50:08 -06:00
@@ -130,6 +130,22 @@ androidCommon.remoteApkExists = function(cb) {
|
||||
});
|
||||
}.bind(this));
|
||||
};
|
||||
androidCommon.uninstallApp = function(cb) {
|
||||
var next = function() {
|
||||
this.adb.uninstallApk(this.appPackage, function(err) {
|
||||
if (err) return cb(err);
|
||||
cb(null);
|
||||
}.bind(this));
|
||||
}.bind(this);
|
||||
|
||||
if (this.skipUninstall) {
|
||||
logger.debug("Not uninstalling app since server not started with " +
|
||||
"--full-reset");
|
||||
cb();
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
};
|
||||
|
||||
androidCommon.installApp = function(cb) {
|
||||
if (this.apkPath === null) {
|
||||
|
||||
@@ -256,22 +256,6 @@ Android.prototype.requestXmlCompression = function(cb) {
|
||||
}
|
||||
};
|
||||
|
||||
Android.prototype.uninstallApp = function(cb) {
|
||||
var next = function() {
|
||||
this.adb.uninstallApk(this.appPackage, function(err) {
|
||||
if (err) return cb(err);
|
||||
cb(null);
|
||||
}.bind(this));
|
||||
}.bind(this);
|
||||
|
||||
if (this.skipUninstall) {
|
||||
logger.debug("Not uninstalling app since server not started with " +
|
||||
"--full-reset");
|
||||
cb();
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
};
|
||||
|
||||
Android.prototype.stop = function(cb) {
|
||||
this.shuttingDown = true;
|
||||
|
||||
@@ -20,6 +20,7 @@ var ADB = require('./adb.js')
|
||||
var Selendroid = function(opts) {
|
||||
this.opts = opts;
|
||||
this.opts.devicePort = 8080;
|
||||
this.skipUninstall = opts.fastReset || !opts.reset;
|
||||
this.opts.systemPort = opts.systemPort;
|
||||
this.avdName = opts.avdName || null;
|
||||
this.appWaitActivity = opts.appWaitActivity;
|
||||
@@ -41,6 +42,7 @@ var Selendroid = function(opts) {
|
||||
, 'keyevent'
|
||||
, 'currentActivity'
|
||||
, 'installApp'
|
||||
, 'uninstallApp'
|
||||
, 'removeApp'
|
||||
, 'closeApp'
|
||||
, 'isAppInstalled'
|
||||
@@ -112,12 +114,13 @@ Selendroid.prototype.start = function(cb) {
|
||||
conditionalInsertManifest,
|
||||
this.checkSelendroidCerts.bind(this),
|
||||
conditionalInstallSelendroid,
|
||||
this.uninstallApp.bind(this),
|
||||
this.installApp.bind(this),
|
||||
this.forwardPort.bind(this),
|
||||
this.pushUnlock.bind(this),
|
||||
this.unlockScreen.bind(this),
|
||||
this.pushSelendroid.bind(this),
|
||||
this.waitForServer.bind(this),
|
||||
this.waitForServer.bind(this)
|
||||
], function(err) {
|
||||
if (err) return cb(err);
|
||||
this.createSession(cb);
|
||||
|
||||
Reference in New Issue
Block a user