Skip to content

Commit

Permalink
fixes stderr and stdout redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
Rolando Abarca committed Apr 3, 2010
1 parent 1a6cc0f commit d53d929
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions Source/iPhoneSimulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
@private
DTiPhoneSimulatorSystemRoot *sdkRoot;
BOOL debug;
NSString *sessionStderr, *sessionStdout;
}

- (void) runWithArgc: (int) argc argv: (char **) argv;
Expand Down
13 changes: 6 additions & 7 deletions Source/iPhoneSimulator.m
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ - (int)launchApp:(NSString *)path withFamily:(NSString*)family uuid:(NSString*)u
DTiPhoneSimulatorSessionConfig *config;
DTiPhoneSimulatorSession *session;
NSError *error;
char *tmp;

/* Create the app specifier */
appSpec = [DTiPhoneSimulatorApplicationSpecifier specifierWithApplicationPath:path];
Expand All @@ -128,13 +127,11 @@ - (int)launchApp:(NSString *)path withFamily:(NSString*)family uuid:(NSString*)u
[config setLocalizedClientName:@"TitaniumDeveloper"];

/* redirect stderr, maybe this could be in a cli option? */
tmp = getenv("STDERR");
if (tmp) {
[config setSimulatedApplicationStdErrPath:[NSString stringWithCString:tmp encoding:NSUTF8StringEncoding]];
if (sessionStderr) {
[config setSimulatedApplicationStdErrPath:sessionStderr];
}
tmp = getenv("STDOUT");
if (tmp) {
[config setSimulatedApplicationStdOutPath:[NSString stringWithCString:tmp encoding:NSUTF8StringEncoding]];
if (sessionStdout) {
[config setSimulatedApplicationStdOutPath:sessionStdout];
}

// this was introduced in 3.2 of SDK
Expand Down Expand Up @@ -202,6 +199,8 @@ - (void)runWithArgc:(int)argc argv:(char **)argv {

// debug option (launch gdb)
debug = [args boolForKey:@"debug"];
sessionStderr = [args stringForKey:@"stderr"];
sessionStdout = [args stringForKey:@"stdout"];

if (strcmp(cmd, "showsdks") == 0) {
exit([self showSDKs]);
Expand Down

0 comments on commit d53d929

Please sign in to comment.