diff --git a/XCTestBootstrap/Utility/FBOToolDynamicLibs.m b/XCTestBootstrap/Utility/FBOToolDynamicLibs.m index 88d7b4ca9..02d07f5c9 100644 --- a/XCTestBootstrap/Utility/FBOToolDynamicLibs.m +++ b/XCTestBootstrap/Utility/FBOToolDynamicLibs.m @@ -13,22 +13,26 @@ @implementation FBOToolDynamicLibs + (FBFuture *)findFullPathForSanitiserDyldInBundle:(NSString *)bundlePath onQueue:(nonnull dispatch_queue_t)queue { return [[FBOToolOperation listSanitiserDylibsRequiredByBundle:bundlePath onQueue:queue] onQueue:queue map:^id _Nonnull(NSArray * _Nonnull libsList) { - + NSString *clanLocation = [FBXcodeConfiguration.developerDirectory stringByAppendingPathComponent:@"Toolchains/XcodeDefault.xctoolchain/usr/lib/clang"]; NSError *error = nil; NSArray *fileList = [self filesInDirectory:[NSURL fileURLWithPath:clanLocation] error:&error]; - + if ([fileList count] == 0 || error) { if(error == nil) return [[FBControlCoreError describeFormat:@"No clang version found in %@", clanLocation] failFuture]; return [FBFuture futureWithError:error]; } - + NSString *libsFolder = [NSString pathWithComponents: @[[fileList[0] path], @"lib/darwin/"]]; - - NSMutableSet *bundleLibsNames = nil; + NSString *bundleFrameworksFolder = [bundlePath stringByAppendingPathComponent:@"Frameworks"]; + if(![[NSFileManager defaultManager] fileExistsAtPath:bundleFrameworksFolder]) { + bundleFrameworksFolder = [bundlePath stringByAppendingPathComponent:@"Contents/Frameworks"]; + } + NSArray *bundleLibs = [self filesInDirectory:[NSURL fileURLWithPath:bundleFrameworksFolder] error:&error]; + NSMutableSet *bundleLibsNames = nil; if (bundleLibs) { bundleLibsNames = [NSMutableSet setWithCapacity:bundleLibs.count]; for(NSURL *libURL in bundleLibs) { @@ -49,7 +53,7 @@ @implementation FBOToolDynamicLibs } [libraries addObject:libPath]; } - + return libraries; }]; }