Skip to content

Commit a110ec9

Browse files
committed
Fixes #130 - Stdout/stderr aren't correctly forwarded for iOS 8+ simulators due to sdk version parsing error
1 parent 62cb423 commit a110ec9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Source/iPhoneSimulator.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,11 @@ - (void)removeStdioFIFO:(NSFileHandle *)fileHandle atPath:(NSString *)path {
363363
}
364364

365365

366+
- (BOOL) version:(NSString*)versionA isAtLeastVersion:(NSString*)versionB
367+
{
368+
return ([versionA compare:versionB options:NSNumericSearch] != NSOrderedAscending);
369+
}
370+
366371
- (int)launchApp:(NSString *)path withFamily:(NSString *)family
367372
uuid:(NSString *)uuid
368373
environment:(NSDictionary *)environment
@@ -441,7 +446,7 @@ - (int)launchApp:(NSString *)path withFamily:(NSString *)family
441446

442447
// The iOS 8 simulator treats stdout/stderr paths relative to the simulator's data directory.
443448
// Create symbolic links in the data directory that points at the real stdout/stderr paths.
444-
if ([config.simulatedSystemRoot.sdkVersion isEqual:@"8.0"]) {
449+
if ([self version:config.simulatedSystemRoot.sdkVersion isAtLeastVersion:@"8.0"]) {
445450
NSString* dataPath = config.device.dataPath;
446451
[[NSFileManager defaultManager] createSymbolicLinkAtPath:[dataPath stringByAppendingPathComponent:stdoutPath] withDestinationPath:stdoutPath error:NULL];
447452
[[NSFileManager defaultManager] createSymbolicLinkAtPath:[dataPath stringByAppendingPathComponent:stderrPath] withDestinationPath:stderrPath error:NULL];

0 commit comments

Comments
 (0)