File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -613,14 +613,16 @@ int main(int argc, char *argv[])
613613static NSString *resolveFrameworkRoot (NSFileManager *fileManager,
614614 NSString *const sdkRoot) {
615615
616- NSString *platformsString = @" Platforms" ;
617- NSRange range = [sdkRoot rangeOfString: platformsString];
616+ NSRange range = [sdkRoot rangeOfString: @" /Platforms/" ];
618617 if (range.location != NSNotFound ) {
619- NSString *platforms = [sdkRoot substringToIndex: (range.location + platformsString.length)];
620- NSString *root = [platforms stringByAppendingString: @" /iPhoneOS.platform/Developer/Library/CoreSimulator/"
621- @" Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot" ];
622- if ([fileManager fileExistsAtPath: root]) {
623- return root;
618+ // In Xcode 11, the directories were reordered. Prefer the Xcode 11 order.
619+ NSUInteger start = range.location + range.length ;
620+ for (NSString *simulator in [NSArray arrayWithObjects: @" iPhoneOS.platform/Library/Developer" , @" iPhoneOS.platform/Developer/Library" , nil ]) {
621+ NSString *candidate = [simulator stringByAppendingString: @" /CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot" ];
622+ NSString *root = [sdkRoot stringByReplacingCharactersInRange: NSMakeRange (start, [sdkRoot length ] - start) withString: candidate];
623+ if ([fileManager fileExistsAtPath: root]) {
624+ return root;
625+ }
624626 }
625627 }
626628
You can’t perform that action at this time.
0 commit comments