ios-sim-portable
Advanced tools
Comparing version 1.0.13-delta to 1.0.13-epsilon
@@ -30,3 +30,3 @@ ///<reference path="./.d.ts"/> | ||
interface ISimctl { | ||
launch(deviceId: string, applicationIdentifier: string): IFuture<void>; | ||
launch(deviceId: string, applicationIdentifier: string): IFuture<string>; | ||
install(deviceId: string, applicationPath: string): IFuture<void>; | ||
@@ -33,0 +33,0 @@ uninstall(deviceId: string, applicationIdentifier: string): IFuture<void>; |
@@ -11,2 +11,3 @@ ///<reference path="./.d.ts"/> | ||
var $ = require("NodObjC"); | ||
var osenv = require("osenv"); | ||
var XCode7Simulator = (function () { | ||
@@ -48,3 +49,24 @@ function XCode7Simulator() { | ||
_this.simctl.install(device.id, applicationPath).wait(); | ||
_this.simctl.launch(device.id, applicationIdentifier).wait(); | ||
var launchResult = _this.simctl.launch(device.id, applicationIdentifier).wait(); | ||
if (options.logging) { | ||
var pid = launchResult.split(":")[1].trim(); | ||
var logFilePath = path.join(osenv.home(), "Library", "Logs", "CoreSimulator", device.id, "system.log"); | ||
var childProcess_1 = require("child_process").spawn("tail", ['-f', '-n', '1', logFilePath]); | ||
if (childProcess_1.stdout) { | ||
childProcess_1.stdout.on("data", function (data) { | ||
var dataAsString = data.toString(); | ||
if (dataAsString.indexOf("[" + pid + "]") > -1) { | ||
console.log(dataAsString); | ||
} | ||
}); | ||
} | ||
if (childProcess_1.stderr) { | ||
childProcess_1.stderr.on("data", function (data) { | ||
var dataAsString = data.toString(); | ||
if (dataAsString.indexOf("[" + pid + "]") > -1) { | ||
console.error(dataAsString); | ||
} | ||
}); | ||
} | ||
} | ||
}).future()(); | ||
@@ -51,0 +73,0 @@ }; |
@@ -14,2 +14,3 @@ ///<reference path="./.d.ts"/> | ||
var $ = require("NodObjC"); | ||
var osenv = require("osenv"); | ||
@@ -59,3 +60,27 @@ export class XCode7Simulator implements ISimulator { | ||
this.simctl.install(device.id, applicationPath).wait(); | ||
this.simctl.launch(device.id, applicationIdentifier).wait(); | ||
let launchResult = this.simctl.launch(device.id, applicationIdentifier).wait(); | ||
if (options.logging) { | ||
let pid = launchResult.split(":")[1].trim(); | ||
let logFilePath = path.join(osenv.home(), "Library", "Logs", "CoreSimulator", device.id, "system.log"); | ||
let childProcess = require("child_process").spawn("tail", ['-f', '-n', '1', logFilePath]); | ||
if(childProcess.stdout) { | ||
childProcess.stdout.on("data", (data: NodeBuffer) => { | ||
let dataAsString = data.toString(); | ||
if (dataAsString.indexOf(`[${pid}]`) > -1) { | ||
console.log(dataAsString); | ||
} | ||
}); | ||
} | ||
if(childProcess.stderr) { | ||
childProcess.stderr.on("data", (data: string) => { | ||
let dataAsString = data.toString(); | ||
if (dataAsString.indexOf(`[${pid}]`) > -1) { | ||
console.error(dataAsString); | ||
} | ||
}); | ||
} | ||
} | ||
}).future<void>()(); | ||
@@ -62,0 +87,0 @@ } |
@@ -11,5 +11,5 @@ ///<reference path="./.d.ts"/> | ||
public launch(deviceId: string, applicationIdentifier: string): IFuture<void> { | ||
public launch(deviceId: string, applicationIdentifier: string): IFuture<string> { | ||
let args: string[] = []; | ||
if(options.waitForDebugger) { | ||
if (options.waitForDebugger) { | ||
args.push("-w"); | ||
@@ -16,0 +16,0 @@ } |
{ | ||
"name": "ios-sim-portable", | ||
"version": "1.0.13-delta", | ||
"version": "1.0.13-epsilon", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./lib/ios-sim.js", |
309486
51
8994
3