Skip to content

Commit

Permalink
only reference libXCTestBundleInject.dylib if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
RainNapper committed Oct 7, 2020
1 parent 2e80798 commit c8a2603
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bp/src/SimulatorHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@ + (NSDictionary *)appLaunchEnvironmentWithBundleID:(NSString *)hostBundleID
NSString *hostAppExecPath = [SimulatorHelper executablePathforPath:config.appBundlePath];
NSString *hostAppPath = [hostAppExecPath stringByDeletingLastPathComponent];
NSString *testSimulatorFrameworkPath = [hostAppPath stringByDeletingLastPathComponent];
NSString *libXCTestBundleInject = [[hostAppPath stringByAppendingPathComponent:@"Frameworks"] stringByAppendingPathComponent:@"libXCTestBundleInject.dylib"];
NSString *libXCTestBundleInjectPath = [[hostAppPath stringByAppendingPathComponent:@"Frameworks"] stringByAppendingPathComponent:@"libXCTestBundleInject.dylib"];
NSString *libXCTestBundleInjectValue = [NSFileManager.defaultManager fileExistsAtPath:libXCTestBundleInjectPath] ? libXCTestBundleInjectPath : @"";
NSMutableDictionary<NSString *, NSString *> *environment = [@{
@"DYLD_FALLBACK_FRAMEWORK_PATH" : [NSString stringWithFormat:@"%@/Library/Frameworks:%@/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks", config.xcodePath, config.xcodePath],
@"DYLD_FALLBACK_LIBRARY_PATH" : [NSString stringWithFormat:@"%@/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib", config.xcodePath],
@"DYLD_INSERT_LIBRARIES" : libXCTestBundleInject,
@"DYLD_INSERT_LIBRARIES" : libXCTestBundleInjectValue,
@"DYLD_LIBRARY_PATH" : [NSString stringWithFormat:@"%@/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks", config.xcodePath],
@"DYLD_ROOT_PATH" : [NSString stringWithFormat:@"%@/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot", config.xcodePath],
@"NSUnbufferedIO" : @"1",
Expand Down

0 comments on commit c8a2603

Please sign in to comment.