Skip to content

Commit aa583e9

Browse files
ntherningshazron
authored andcommitted
Fixes #95 - The iOS 8 simulator treats stdout/stderr paths relative to the simulator's data directory. Create symbolic links to the configured stdout/stderr paths so that stdout/stderr output is processed properly when running apps in the iOS 8 simulator.
Signed-off-by: Shazron Abdullah <[email protected]>
1 parent e262298 commit aa583e9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Source/iPhoneSimulator.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,14 @@ - (int)launchApp:(NSString *)path withFamily:(NSString *)family
396396
if ([config respondsToSelector:@selector(setDevice:)]) {
397397
// Xcode6+
398398
config.device = [self findDeviceWithFamily:family retina:retinaDevice isTallDevice:tallDevice is64Bit:is64BitDevice];
399+
400+
// The iOS 8 simulator treats stdout/stderr paths relative to the simulator's data directory.
401+
// Create symbolic links in the data directory that points at the real stdout/stderr paths.
402+
if ([config.simulatedSystemRoot.sdkVersion isEqual:@"8.0"]) {
403+
NSString* dataPath = config.device.dataPath;
404+
[[NSFileManager defaultManager] createSymbolicLinkAtPath:[dataPath stringByAppendingPathComponent:stdoutPath] withDestinationPath:stdoutPath error:NULL];
405+
[[NSFileManager defaultManager] createSymbolicLinkAtPath:[dataPath stringByAppendingPathComponent:stderrPath] withDestinationPath:stderrPath error:NULL];
406+
}
399407
} else {
400408
// Xcode5 or older
401409
NSString* devicePropertyValue = [self changeDeviceType:family retina:retinaDevice isTallDevice:tallDevice is64Bit:is64BitDevice];

0 commit comments

Comments
 (0)