Skip to content

Commit

Permalink
Fixes #95 - The iOS 8 simulator treats stdout/stderr paths relative t…
Browse files Browse the repository at this point in the history
…o 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 <shazron@gmail.com>
  • Loading branch information
ntherning authored and shazron committed Aug 7, 2014
1 parent e262298 commit aa583e9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Source/iPhoneSimulator.m
Expand Up @@ -396,6 +396,14 @@ - (int)launchApp:(NSString *)path withFamily:(NSString *)family
if ([config respondsToSelector:@selector(setDevice:)]) {
// Xcode6+
config.device = [self findDeviceWithFamily:family retina:retinaDevice isTallDevice:tallDevice is64Bit:is64BitDevice];

// The iOS 8 simulator treats stdout/stderr paths relative to the simulator's data directory.
// Create symbolic links in the data directory that points at the real stdout/stderr paths.
if ([config.simulatedSystemRoot.sdkVersion isEqual:@"8.0"]) {
NSString* dataPath = config.device.dataPath;
[[NSFileManager defaultManager] createSymbolicLinkAtPath:[dataPath stringByAppendingPathComponent:stdoutPath] withDestinationPath:stdoutPath error:NULL];
[[NSFileManager defaultManager] createSymbolicLinkAtPath:[dataPath stringByAppendingPathComponent:stderrPath] withDestinationPath:stderrPath error:NULL];
}
} else {
// Xcode5 or older
NSString* devicePropertyValue = [self changeDeviceType:family retina:retinaDevice isTallDevice:tallDevice is64Bit:is64BitDevice];
Expand Down

0 comments on commit aa583e9

Please sign in to comment.