appium-instruments
Advanced tools
Comparing version 1.1.2 to 1.2.0
@@ -26,3 +26,3 @@ // Wrapper around Apple's Instruments app | ||
} catch (err) { | ||
console.warn("Invalid launch timeout: " + opts.launchTimeout); | ||
logger.warn("Invalid launch timeout: " + opts.launchTimeout); | ||
} | ||
@@ -46,3 +46,3 @@ } | ||
if (typeof opts.isSafariLauncherApp !== "undefined") { | ||
console.warn("The `isSafariLauncherApp` option is deprecated. Use the " + | ||
logger.warn("The `isSafariLauncherApp` option is deprecated. Use the " + | ||
"`ignoreStartupExit` option instead"); | ||
@@ -66,3 +66,2 @@ } | ||
this.instrumentsPath = ""; | ||
this.logNoColors = opts.logNoColors; | ||
this.processArguments = opts.processArguments; | ||
@@ -105,3 +104,3 @@ this.simulatorSdkAndDevice = opts.simulatorSdkAndDevice; | ||
} | ||
logger.info("Instruments is at: " + this.instrumentsPath); | ||
logger.debug("Instruments is at: " + this.instrumentsPath); | ||
cb(); | ||
@@ -126,3 +125,3 @@ }.bind(this)); | ||
this.launchTries++; | ||
logger.info("Attempting to retry launching instruments, this is " + | ||
logger.debug("Attempting to retry launching instruments, this is " + | ||
"retry #" + this.launchTries); | ||
@@ -138,6 +137,6 @@ // waiting a bit before restart | ||
} | ||
logger.error(err.message); | ||
logger.debug(err.message); | ||
} | ||
} else { | ||
logger.info("Trying to call back from instruments launch but we " + | ||
logger.debug("Trying to call back from instruments launch but we " + | ||
"already did"); | ||
@@ -149,5 +148,5 @@ } | ||
if (this.proc !== null) { | ||
logger.info("Sending sigterm to instruments"); | ||
logger.debug("Sending sigterm to instruments"); | ||
this.termTimer = setTimeout(function () { | ||
logger.info("Instruments didn't terminate after " + (this.termTimeout / 1000) + | ||
logger.debug("Instruments didn't terminate after " + (this.termTimeout / 1000) + | ||
" seconds; trying to kill it"); | ||
@@ -161,3 +160,3 @@ this.killProc(); | ||
Instruments.prototype.killProc = function () { | ||
logger.info("Killall instruments"); | ||
logger.debug("Killall instruments"); | ||
exec('pkill -9 -f instruments'); | ||
@@ -167,3 +166,3 @@ }; | ||
Instruments.prototype.killIPhoneSim = function () { | ||
logger.info("Killall iPhoneSimulator"); | ||
logger.debug("Killall iPhoneSimulator"); | ||
exec('pkill -9 -f iPhoneSimulator'); | ||
@@ -174,3 +173,3 @@ }; | ||
return function () { | ||
logger.warn(("Instruments socket client never checked in; timing out (" + desc + ")").red); | ||
logger.warn("Instruments socket client never checked in; timing out (" + desc + ")"); | ||
this.neverConnected = true; | ||
@@ -186,3 +185,3 @@ this.killProc(); | ||
var warnlevel = 10; // if we pass 10 attempts to kill but fail, log a warning | ||
logger.warn("Launching instruments briefly then killing it"); | ||
logger.info("Launching instruments briefly then killing it"); | ||
this.setInstrumentsPath(function (err) { | ||
@@ -220,3 +219,3 @@ if (err) return cb(err); | ||
Instruments.prototype.launch = function (cb) { | ||
logger.warn("Launching instruments"); | ||
logger.info("Launching instruments"); | ||
// prepare temp dir | ||
@@ -235,3 +234,3 @@ var tmpDir = "/tmp/appium-instruments"; | ||
this.proc.on("error", function (err) { | ||
logger.info("Error with instruments proc: " + err.message); | ||
logger.error("Error with instruments proc: " + err.message); | ||
if (err.message.indexOf("ENOENT") !== -1) { | ||
@@ -267,3 +266,3 @@ this.proc = null; // otherwise we'll try to send sigkill | ||
args = args.concat(["-w", this.udid]); | ||
logger.info("Attempting to run app on real device with UDID " + this.udid); | ||
logger.debug("Attempting to run app on real device with UDID " + this.udid); | ||
} | ||
@@ -281,7 +280,7 @@ if (!this.udid && this.simulatorSdkAndDevice) { | ||
if (simulatorSdkAndDevice !== this.simulatorSdkAndDevice) | ||
logger.info("Instruments device was changed from:\"", this.simulatorSdkAndDevice, "\" to:\"", | ||
logger.debug("Instruments device was changed from:\"", this.simulatorSdkAndDevice, "\" to:\"", | ||
simulatorSdkAndDevice + "\""); | ||
args = args.concat(["-w", simulatorSdkAndDevice]); | ||
logger.info("Attempting to run app on " + simulatorSdkAndDevice); | ||
logger.debug("Attempting to run app on " + simulatorSdkAndDevice); | ||
} | ||
@@ -291,3 +290,3 @@ args = args.concat([this.app]); | ||
args = args.concat(this.processArguments); | ||
logger.info("Attempting to run app with process arguments: " + this.processArguments); | ||
logger.debug("Attempting to run app with process arguments: " + this.processArguments); | ||
} | ||
@@ -305,9 +304,9 @@ args = args.concat(["-e", "UIASCRIPT", this.bootstrap]); | ||
} | ||
logger.info("Spawning instruments with command: " + this.instrumentsPath + | ||
logger.debug("Spawning instruments with command: " + this.instrumentsPath + | ||
" " + args.join(" ")); | ||
logger.info("And extra without-delay env: " + JSON.stringify({ | ||
logger.debug("And extra without-delay env: " + JSON.stringify({ | ||
DYLD_INSERT_LIBRARIES: env.DYLD_INSERT_LIBRARIES, | ||
LIB_PATH: env.LIB_PATH | ||
})); | ||
logger.info("And launch timeouts (in ms): " + JSON.stringify(this.launchTimeout)); | ||
logger.debug("And launch timeouts (in ms): " + JSON.stringify(this.launchTimeout)); | ||
return spawn(this.instrumentsPath, args, {env: env}); | ||
@@ -338,3 +337,3 @@ }; | ||
if (this.ignoreStartupExit) { | ||
logger.info("Not worrying about instruments exit since we're using " + | ||
logger.debug("Not worrying about instruments exit since we're using " + | ||
"SafariLauncher"); | ||
@@ -352,3 +351,3 @@ this.launchHandler(); | ||
Instruments.prototype.cleanupInstruments = function () { | ||
logger.info("Cleaning up after instruments exit"); | ||
logger.debug("Cleaning up after instruments exit"); | ||
this.proc = null; | ||
@@ -358,3 +357,3 @@ }; | ||
Instruments.prototype.getAvailableDevices = function (cb) { | ||
logger.warn("Getting list of devices instruments supports"); | ||
logger.debug("Getting list of devices instruments supports"); | ||
this.setInstrumentsPath(function (err) { | ||
@@ -395,3 +394,3 @@ if (err) return cb(err); | ||
Instruments.prototype.doExit = function () { | ||
console.log("Calling exit handler"); | ||
logger.info("Calling exit handler"); | ||
}; | ||
@@ -425,6 +424,4 @@ | ||
var logMsg = ("[INST STDERR] " + output); | ||
if (!this.logNoColors) { | ||
logMsg = logMsg.yellow; | ||
} | ||
logger.info(logMsg); | ||
logMsg = logMsg.yellow; | ||
logger.debug(logMsg); | ||
if (this.webSocket) { | ||
@@ -434,3 +431,3 @@ var re = /Call to onAlert returned 'YES'/; | ||
if (match) { | ||
logger.info("Emiting alert message..."); | ||
logger.debug("Emiting alert message..."); | ||
this.webSocket.sockets.emit('alert', {message: output}); | ||
@@ -461,6 +458,4 @@ } | ||
output = "[INST] " + output; | ||
if (!this.logNoColors) { | ||
output = output.green; | ||
} | ||
logger.info(output); | ||
output = output.green; | ||
logger.debug(output); | ||
} | ||
@@ -470,3 +465,3 @@ }; | ||
Instruments.prototype.defaultExitHandler = function (code, traceDir) { | ||
logger.info("Instruments exited with code " + code + " and trace dir " + traceDir); | ||
logger.debug("Instruments exited with code " + code + " and trace dir " + traceDir); | ||
}; | ||
@@ -486,10 +481,6 @@ | ||
var log = "[INSTSERVER] " + msg; | ||
if (!this.logNoColors) { | ||
log = log.grey; | ||
} | ||
logger.info(log); | ||
log = log.grey; | ||
logger.debug(log); | ||
}; | ||
module.exports = Instruments; |
{ | ||
"name": "appium-instruments", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"description": "IOS Instruments + instruments-without-delay launcher used by Appium", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
26
615441
63
671