зеркало из https://github.com/microsoft/appium.git
extracted appium-adb npm package
This commit is contained in:
Родитель
8afae17051
Коммит
06d60fc9ee
|
@ -43,3 +43,6 @@
|
|||
path = submodules/appium-uiauto
|
||||
url = https://github.com/appium/appium-uiauto.git
|
||||
branch = published
|
||||
[submodule "submodules/appium-adb"]
|
||||
path = submodules/appium-adb
|
||||
url = git@github.com:appium/appium-adb.git
|
||||
|
|
|
@ -6,6 +6,7 @@ ALL_PACKAGES=(
|
|||
'appium-atoms'
|
||||
'appium-instruments'
|
||||
'appium-uiauto'
|
||||
'appium-adb'
|
||||
)
|
||||
|
||||
PACKAGES=()
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Двоичные данные
lib/devices/android/helpers/move_manifest.jar
Двоичные данные
lib/devices/android/helpers/move_manifest.jar
Двоичный файл не отображается.
Двоичные данные
lib/devices/android/helpers/sign.jar
Двоичные данные
lib/devices/android/helpers/sign.jar
Двоичный файл не отображается.
Двоичные данные
lib/devices/android/helpers/strings_from_apk.jar
Двоичные данные
lib/devices/android/helpers/strings_from_apk.jar
Двоичный файл не отображается.
Двоичные данные
lib/devices/android/helpers/unsign.jar
Двоичные данные
lib/devices/android/helpers/unsign.jar
Двоичный файл не отображается.
Двоичные данные
lib/devices/android/helpers/verify.jar
Двоичные данные
lib/devices/android/helpers/verify.jar
Двоичный файл не отображается.
|
@ -1,120 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var spawn = require('win-spawn')
|
||||
, through = require('through')
|
||||
, EventEmitter = require('events').EventEmitter
|
||||
, util = require('util')
|
||||
, _ = require('underscore')
|
||||
, logger = require('../../server/logger.js').get('appium');
|
||||
|
||||
var Logcat = function (opts) {
|
||||
EventEmitter.call(this);
|
||||
this.adbCmd = opts.adbCmd;
|
||||
this.debug = opts.debug;
|
||||
this.debugTrace = opts.debugTrace;
|
||||
this.proc = null;
|
||||
this.onLogcatStart = null;
|
||||
this.logcatStarted = false;
|
||||
this.calledBack = false;
|
||||
this.logs = [];
|
||||
this.logsSinceLastRequest = [];
|
||||
};
|
||||
|
||||
util.inherits(Logcat, EventEmitter);
|
||||
|
||||
Logcat.prototype.startCapture = function (cb) {
|
||||
this.onLogcatStart = cb;
|
||||
logger.info("Starting logcat capture");
|
||||
var args = this.adbCmd.split(' ').concat(['logcat']);
|
||||
var adbCmd = args.shift();
|
||||
this.proc = spawn(adbCmd, args);
|
||||
this.proc.stdout.setEncoding('utf8');
|
||||
this.proc.stderr.setEncoding('utf8');
|
||||
this.proc.on('error', function (err) {
|
||||
logger.error('Logcat capture failed: ' + err.message);
|
||||
if (!this.calledBack) {
|
||||
this.calledBack = true;
|
||||
cb(err);
|
||||
}
|
||||
}.bind(this));
|
||||
this.proc.on('exit', function (code, signal) {
|
||||
logger.debug('Logcat terminated with code ' + code + ', signal ' + signal);
|
||||
this.proc = null;
|
||||
}.bind(this));
|
||||
this.proc.stdout.pipe(through(this.onStdout.bind(this)));
|
||||
this.proc.stderr.pipe(through(this.onStderr.bind(this)));
|
||||
};
|
||||
|
||||
Logcat.prototype.stopCapture = function (cb) {
|
||||
logger.info("Stopping logcat capture");
|
||||
if (this.proc === null) {
|
||||
logger.debug("Logcat already stopped");
|
||||
cb();
|
||||
return;
|
||||
}
|
||||
this.proc.on('exit', function () {
|
||||
cb();
|
||||
});
|
||||
this.proc.kill();
|
||||
this.proc = null;
|
||||
};
|
||||
|
||||
Logcat.prototype.onStdout = function (data) {
|
||||
this.onOutput(data, '');
|
||||
};
|
||||
|
||||
Logcat.prototype.onStderr = function (data) {
|
||||
if (/execvp\(\)/.test(data)) {
|
||||
logger.error('Logcat process failed to start');
|
||||
if (!this.calledBack) {
|
||||
this.calledBack = true;
|
||||
this.onLogcatStart(new Error("Logcat process failed to start"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.onOutput(data, ' STDERR');
|
||||
};
|
||||
|
||||
Logcat.prototype.onOutput = function (data, prefix) {
|
||||
if (!this.logcatStarted) {
|
||||
this.logcatStarted = true;
|
||||
if (!this.calledBack) {
|
||||
this.calledBack = true;
|
||||
this.onLogcatStart();
|
||||
}
|
||||
}
|
||||
data = data.trim();
|
||||
data = data.replace(/\r\n/g, "\n");
|
||||
var logs = data.split("\n");
|
||||
_.each(logs, function (log) {
|
||||
log = log.trim();
|
||||
if (log) {
|
||||
var logObj = {
|
||||
timestamp: Date.now()
|
||||
, level: 'ALL'
|
||||
, message: log
|
||||
};
|
||||
this.logs.push(logObj);
|
||||
this.logsSinceLastRequest.push(logObj);
|
||||
this.emit('log', logObj);
|
||||
var isTrace = /W\/Trace/.test(data);
|
||||
if (this.debug && (!isTrace || this.debugTrace)) {
|
||||
logger.debug('[LOGCAT' + prefix + '] ' + log);
|
||||
}
|
||||
}
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
Logcat.prototype.getLogs = function () {
|
||||
var ret = this.logsSinceLastRequest;
|
||||
this.logsSinceLastRequest = [];
|
||||
return ret;
|
||||
};
|
||||
|
||||
Logcat.prototype.getAllLogs = function () {
|
||||
return this.logs;
|
||||
};
|
||||
|
||||
module.exports = function (opts) {
|
||||
return new Logcat(opts);
|
||||
};
|
|
@ -476,26 +476,6 @@ exports.getGitRev = function (cb) {
|
|||
});
|
||||
};
|
||||
|
||||
exports.getAndroidPlatform = function () {
|
||||
var androidHome = process.env.ANDROID_HOME;
|
||||
if (typeof androidHome !== "string") {
|
||||
logger.error("ANDROID_HOME was not exported!");
|
||||
return null;
|
||||
}
|
||||
|
||||
var locs = ['android-4.2', 'android-17', 'android-4.3', 'android-18',
|
||||
'android-4.4', 'android-19'];
|
||||
var res = null;
|
||||
_.each(locs.reverse(), function (loc) {
|
||||
var platforms = path.resolve(androidHome, 'platforms')
|
||||
, platform = loc;
|
||||
if (res === null && fs.existsSync(path.resolve(platforms, platform))) {
|
||||
res = [platform, path.resolve(platforms, platform)];
|
||||
}
|
||||
});
|
||||
return res;
|
||||
};
|
||||
|
||||
exports.getXcodeFolder = function (cb) {
|
||||
exec('xcode-select --print-path', { maxBuffer: 524288, timeout: 3000 }, function (err, stdout, stderr) {
|
||||
if (!err) {
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"adm-zip": "~0.4.4",
|
||||
"appium-adb": "~1.0.1",
|
||||
"appium-atoms": "~0.0.5",
|
||||
"appium-instruments": "~0.1.21",
|
||||
"appium-uiauto": "~0.0.20",
|
||||
|
|
2
reset.sh
2
reset.sh
|
@ -190,6 +190,8 @@ reset_ios() {
|
|||
run_cmd ./bin/npmlink.sh -l appium-instruments
|
||||
echo "* Cloning/npm linking appium-uiauto"
|
||||
run_cmd ./bin/npmlink.sh -l appium-uiauto
|
||||
echo "* Cloning/npm linking appium-adb"
|
||||
run_cmd ./bin/npmlink.sh -l appium-adb
|
||||
fi
|
||||
if $ios7_active ; then
|
||||
if $hardcore ; then
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 74de17a43170e621d1432fe64270f45a43ce5f81
|
|
@ -49,14 +49,17 @@ describe("apidemo - find - basics", function () {
|
|||
.elementsByClassName(atv).should.eventually.exist
|
||||
.nodeify(done);
|
||||
});
|
||||
it('should find a single element by id', function (done) {
|
||||
|
||||
// TODO: The new version of ApiDemo doesn't use id, find a better example.
|
||||
it('should find a single element by id @skip-android-all', function (done) {
|
||||
driver
|
||||
.complexFind(["scroll", [[3, "views"]], [[7, "views"]]]).click()
|
||||
.elementByXPath("//android.widget.TextView[@text='Buttons']").click()
|
||||
.elementById("buttons_1_normal").text().should.become("Normal")
|
||||
.nodeify(done);
|
||||
});
|
||||
it('should find a single element by string id', function (done) {
|
||||
// TODO: The new version of ApiDemo doesn't use id, find a better example.
|
||||
it('should find a single element by string id @skip-android-all', function (done) {
|
||||
driver
|
||||
.elementById("activity_sample_code").text().should.become("API Demos")
|
||||
.nodeify(done);
|
||||
|
|
Загрузка…
Ссылка в новой задаче