Merge pull request #3079 from sebv/tmp-dir

appium-instruments and appium-uiauto know about tmpDir
This commit is contained in:
seb vincent
2014-07-08 00:16:07 -07:00
4 changed files with 11 additions and 10 deletions

View File

@@ -5,7 +5,6 @@ var path = require('path')
, fs = require('fs')
, _ = require('underscore')
, logger = require('../../server/logger.js').get('appium')
, sock = '/tmp/instruments_sock'
, glob = require('glob')
, exec = require('child_process').exec
, spawn = require('child_process').spawn
@@ -131,6 +130,7 @@ IOS.prototype.setIOSArgs = function () {
"http://" + this.args.robotAddress + ":" + this.args.robotPort + "" :
null;
this.curOrientation = this.args.initialOrientation;
this.sock = path.resolve(this.args.tmpDir || '/tmp', 'instruments_sock');
};
IOS.prototype.configureApp = function (cb) {
@@ -237,11 +237,11 @@ IOS.prototype.preCleanup = function (cb) {
var removeSocket = function (innerCb) {
logger.debug("Removing any remaining instruments sockets");
rimraf(sock, function (err) {
rimraf(this.sock, function (err) {
if (err) return innerCb(err);
logger.debug("Cleaned up instruments socket " + sock);
logger.debug("Cleaned up instruments socket " + this.sock);
innerCb();
});
}.bind(this));
}.bind(this);
async.series([removeSocket, removeTracedirs], cb);
@@ -289,7 +289,7 @@ IOS.prototype.start = function (cb, onDie) {
IOS.prototype.createInstruments = function (cb) {
logger.debug("Creating instruments");
this.commandProxy = new CommandProxy({ sock: sock });
this.commandProxy = new CommandProxy({ sock: this.sock });
this.makeInstruments(function (err, instruments) {
if (err) return cb(err);
this.instruments = instruments;
@@ -338,7 +338,7 @@ IOS.prototype.startInstruments = function (cb) {
IOS.prototype.makeInstruments = function (cb) {
// at the moment all the logging in uiauto is at debug level
// TODO: be able to use info in appium-uiauto
prepareBootstrap().then(
prepareBootstrap({sock: this.sock}).then(
function (bootstrapPath) {
var instruments = new Instruments({
app: this.args.app || this.args.bundleId
@@ -353,6 +353,7 @@ IOS.prototype.makeInstruments = function (cb) {
, launchTimeout: this.args.launchTimeout
, flakeyRetries: this.args.backendRetries
, simulatorSdkAndDevice: this.iOSSDKVersion >= 7.1 ? this.getDeviceString() : null
, tmpDir: path.resolve(this.args.tmpDir , 'appium-instruments')
});
cb(null, instruments);
}.bind(this), function (err) { cb(err); }

View File

@@ -43,8 +43,8 @@
"adm-zip": "~0.4.4",
"appium-adb": "~1.3.1",
"appium-atoms": "~0.0.5",
"appium-instruments": "~1.2.0",
"appium-uiauto": "~1.5.0",
"appium-instruments": "~1.3.0",
"appium-uiauto": "~1.6.0",
"argparse": "~0.1.15",
"async": "~0.9.0",
"binary-cookies": "~0.1.1",