ios-sim-portable
Advanced tools
Comparing version 1.0.11-beta to 1.0.12-beta
///<reference path="./.d.ts"/> | ||
"use strict"; | ||
var child_process = require("child_process"); | ||
var errors = require("./errors"); | ||
var Future = require("fibers/future"); | ||
@@ -11,3 +10,3 @@ var util = require("util"); | ||
if (error) { | ||
errors.fail("Error " + error.message + " while executing " + command + "."); | ||
future.throw(new Error("Error " + error.message + " while executing " + command + ".")); | ||
} | ||
@@ -42,3 +41,3 @@ else { | ||
else { | ||
future.throw(util.format("Command %s with arguments %s failed with exit code %s. Error output: \n %s", command, args.join(" "), exitCode, capturedErr)); | ||
future.throw(new Error(util.format("Command %s with arguments %s failed with exit code %s. Error output:\n %s", command, args.join(" "), exitCode, capturedErr))); | ||
} | ||
@@ -45,0 +44,0 @@ }); |
@@ -14,3 +14,3 @@ ///<reference path="./.d.ts"/> | ||
if(error) { | ||
errors.fail(`Error ${error.message} while executing ${command}.`); | ||
future.throw(new Error(`Error ${error.message} while executing ${command}.`)); | ||
} else { | ||
@@ -48,3 +48,3 @@ future.return(stdout ? stdout.toString() : ""); | ||
} else { | ||
future.throw(util.format("Command %s with arguments %s failed with exit code %s. Error output: \n %s", command, args.join(" "), exitCode, capturedErr)); | ||
future.throw(new Error(util.format("Command %s with arguments %s failed with exit code %s. Error output:\n %s", command, args.join(" "), exitCode, capturedErr))); | ||
} | ||
@@ -51,0 +51,0 @@ }); |
///<reference path="./.d.ts"/> | ||
"use strict"; | ||
import util = require("util"); | ||
import * as util from "util"; | ||
@@ -6,0 +6,0 @@ export function fail(errorMessage: string, ...args: string[]) { |
@@ -35,2 +35,6 @@ ///<reference path="./.d.ts"/> | ||
var device = _this.getDeviceToRun().wait(); | ||
var currentBootedDevice = _.find(_this.getDevices().wait(), function (device) { return _this.isDeviceBooted(device); }); | ||
if (currentBootedDevice && (currentBootedDevice.name.toLowerCase() !== device.name.toLowerCase() || currentBootedDevice.runtimeVersion !== device.runtimeVersion)) { | ||
_this.killSimulator().wait(); | ||
} | ||
if (!_this.isDeviceBooted(device)) { | ||
@@ -102,2 +106,5 @@ _this.startSimulator(device).wait(); | ||
}; | ||
XCode7Simulator.prototype.killSimulator = function () { | ||
return childProcess.spawn("pkill", ["-9", "-f", "Simulator"]); | ||
}; | ||
XCode7Simulator.DEVICE_IDENTIFIER_PREFIX = "com.apple.CoreSimulator.SimDeviceType"; | ||
@@ -104,0 +111,0 @@ XCode7Simulator.DEFAULT_DEVICE_NAME = "iPhone 6"; |
@@ -44,2 +44,6 @@ ///<reference path="./.d.ts"/> | ||
let device = this.getDeviceToRun().wait(); | ||
let currentBootedDevice = _.find(this.getDevices().wait(), device => this.isDeviceBooted(device)); | ||
if(currentBootedDevice && (currentBootedDevice.name.toLowerCase() !== device.name.toLowerCase() || currentBootedDevice.runtimeVersion !== device.runtimeVersion)) { | ||
this.killSimulator().wait(); | ||
} | ||
@@ -122,2 +126,6 @@ if(!this.isDeviceBooted(device)) { | ||
} | ||
private killSimulator(): IFuture<any> { | ||
return childProcess.spawn("pkill", ["-9", "-f", "Simulator"]); | ||
} | ||
} |
@@ -99,4 +99,4 @@ ///<reference path="./.d.ts"/> | ||
Simctl.prototype.simctlExec = function (command, args) { | ||
args = ["xcrun", "simctl", command].concat(args); | ||
return childProcess.exec(args.join(" ")); | ||
args = ["simctl", command].concat(args); | ||
return childProcess.spawn("xcrun", args); | ||
}; | ||
@@ -103,0 +103,0 @@ return Simctl; |
@@ -117,5 +117,5 @@ ///<reference path="./.d.ts"/> | ||
private simctlExec(command: string, args: string[]): IFuture<any> { | ||
args = ["xcrun", "simctl", command, ...args]; | ||
return childProcess.exec(args.join(" ")); | ||
args = ["simctl", command, ...args]; | ||
return childProcess.spawn("xcrun", args); | ||
} | ||
} | ||
} |
{ | ||
"name": "ios-sim-portable", | ||
"version": "1.0.11-beta", | ||
"version": "1.0.12-beta", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./lib/ios-sim.js", |
297950
50
8784