Skip to content

Commit 980ab2c

Browse files
Fatme HavaluovaFatme Havaluova
authored andcommitted
Exit, stderr and stdout options
1 parent 2abd6ce commit 980ab2c

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lib/iphone-simulator.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,11 @@ export class iPhoneSimulator implements IiPhoneSimulator {
7474
iPhoneSimulator.logSessionInfo(error, "Session ended without errors.", "Session ended with error ");
7575
process.exit(0);
7676
});
77-
sessionDelegate.addMethod("session:didStart:withError:", "v@:@c@", function(self: any, sel: any, sess: any, did: any, error:any) {
77+
sessionDelegate.addMethod("session:didStart:withError:", "v@:@c@", function(self: any, sel: string, session: any, started: boolean, error:any) {
7878
iPhoneSimulator.logSessionInfo(error, "Session started without errors.", "Session started with error ");
79+
if(options.exit) {
80+
process.exit(0);
81+
}
7982
});
8083
sessionDelegate.register();
8184

@@ -95,6 +98,14 @@ export class iPhoneSimulator implements IiPhoneSimulator {
9598
}
9699
simulator.setSimulatedDevice(config);
97100

101+
if(options.stderr) {
102+
config("setSimulatedApplicationStdErrPath", $(options.stderr));
103+
}
104+
105+
if(options.stdout) {
106+
config("setSimulatedApplicationStdOutPath", $(options.stdout));
107+
}
108+
98109
config("setLocalizedClientName", $("ios-sim-portable"));
99110

100111
var sessionError: any = new Buffer("");

lib/options.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ var yargs = require("yargs");
55

66
var knownOptions: any = {
77
"debug": Boolean,
8+
"exit": Boolean,
89
"device": String,
910
"stdout": String,
1011
"stderr": String,

0 commit comments

Comments
 (0)