mirror of
https://github.com/appium/appium.git
synced 2026-02-09 03:09:02 -06:00
Bugfixes for desired_capabilities updating and for ios_logging
This commit is contained in:
@@ -531,6 +531,7 @@ Appium.prototype.initDevice = function() {
|
||||
, robotPort: this.args.robotPort
|
||||
, robotAddress: this.args.robotAddress
|
||||
, isSafariLauncherApp: this.isSafariLauncherApp
|
||||
, desiredCapabilities: this.desiredCapabilities
|
||||
};
|
||||
this.device = ios(iosOpts);
|
||||
} else if (this.isAndroid()) {
|
||||
@@ -554,6 +555,7 @@ Appium.prototype.initDevice = function() {
|
||||
, keyAlias: this.args.keyAlias
|
||||
, keyPassword: this.args.keyPassword
|
||||
, systemPort: this.args.devicePort
|
||||
, desiredCapabilities: this.desiredCapabilities
|
||||
};
|
||||
if (this.isChrome()) {
|
||||
androidOpts.chromium = this.args.chromium;
|
||||
|
||||
@@ -658,6 +658,9 @@ ADB.prototype.startApp = function(pkg, activity, waitActivity, cb) {
|
||||
if(err) return cb(err);
|
||||
if (stdout.indexOf("Error: Activity class") !== -1 &&
|
||||
stdout.indexOf("does not exist") !== -1) {
|
||||
if (!activity) {
|
||||
return cb(new Error("Parameter 'app-activity' is required for launching application"));
|
||||
}
|
||||
if (activity[0] !== ".") {
|
||||
logger.info("We tried to start an activity that doesn't exist, " +
|
||||
"retrying with . prepended to activity");
|
||||
|
||||
@@ -60,6 +60,7 @@ Android.prototype.initialize = function(opts) {
|
||||
, javascriptEnabled: true
|
||||
, databaseEnabled: false
|
||||
};
|
||||
_.extend(this.capabilities, opts.desiredCapabilities);
|
||||
};
|
||||
|
||||
Android.prototype.start = function(cb, onDie) {
|
||||
@@ -190,6 +191,9 @@ Android.prototype.pushStrings = function(cb) {
|
||||
} else {
|
||||
var stringsFromApkJarPath = path.resolve(helperJarPath,
|
||||
'strings_from_apk.jar');
|
||||
if (!this.appPackage) {
|
||||
return cb(new Error("Parameter 'app-package' is required for launching application"));
|
||||
}
|
||||
var outputPath = path.resolve(getTempPath(), this.appPackage);
|
||||
var makeStrings = ['java -jar "', stringsFromApkJarPath,
|
||||
'" "', this.apkPath, '" "', outputPath, '"'].join('');
|
||||
|
||||
@@ -35,18 +35,18 @@ IosLog.prototype.startCapture = function(cb) {
|
||||
if (this.udid) {
|
||||
var spawnEnv = _.clone(process.env);
|
||||
spawnEnv.PATH = process.env.PATH + ":" + process.cwd() + "/build/libimobiledevice-macosx/";
|
||||
spawnEnv.DYLD_LIBRARY_PATH = process.cwd() + "/build/libimobiledevice-macosx/:" + process.env.DYLD_LIBRARY_PATH
|
||||
spawnEnv.DYLD_LIBRARY_PATH = process.cwd() + "/build/libimobiledevice-macosx/:" + process.env.DYLD_LIBRARY_PATH;
|
||||
this.debug("Starting iOS device log capture via idevicesyslog");
|
||||
this.proc = spawn("idevicesyslog", ["-u", this.udid], {env: spawnEnv});
|
||||
}
|
||||
else {
|
||||
if (parseInt(this.xcodeVersion.split(".")[0], 10) >= 5) {
|
||||
this.debug("Starting iOS 7.* simulator log capture");
|
||||
this.proc = spawn("tail", ["-f", "-n0", process.env.HOME + "/Library/Logs/iOS Simulator/7.0/system.log"]);
|
||||
this.proc = spawn("tail", ["-f", "-n1", process.env.HOME + "/Library/Logs/iOS Simulator/7.0/system.log"]);
|
||||
}
|
||||
else {
|
||||
this.debug("Starting iOS 6.* simulator log capture");
|
||||
this.proc = spawn("tail", ["-f", "-n0", "/var/log/system.log"]);
|
||||
this.proc = spawn("tail", ["-f", "-n1", "/var/log/system.log"]);
|
||||
}
|
||||
}
|
||||
this.proc.stdout.setEncoding('utf8');
|
||||
|
||||
@@ -76,6 +76,7 @@ var IOS = function(args) {
|
||||
, databaseEnabled: false
|
||||
, takesScreenshot: true
|
||||
};
|
||||
_.extend(this.capabilities, args.desiredCapabilities);
|
||||
this.supportedStrategies = ["name", "tag name", "xpath", "id"];
|
||||
this.localizableStrings = {};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user