Skip to content

Commit 199e4c1

Browse files
author
Mike Richter
committed
Merged PR 3898: Merge mrichter/support-xcode11 to master
Support Xcode 11 by checking for libraries in the new location. Related work items: #18463
2 parents 84525ee + f3171c1 commit 199e4c1

3 files changed

Lines changed: 18 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ Change Log
66
-----------------------
77

88
### Enhancements:
9+
10+
* Now supports Xcode 11 and iOS 13.
11+
912
### Changes:
13+
14+
* Xcode 9 is no longer supported.
15+
1016
### Fixes:
1117

1218

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ Supported Platforms
4545

4646
*PPiOS-Rename* supports apps developed for:
4747

48-
* iOS 10, iOS 11, iOS 12
48+
* iOS 11, iOS 12, iOS 13
4949
* iPhone, iPod touch, and iPad
5050
* ARM 32-bit, ARM 64-bit, and x86 Simulator
5151

5252
Using:
5353

54-
* Xcode 9, Xcode 10
54+
* Xcode 10, Xcode 11
5555
* Objective-C
5656

5757
> Note: Swift is not supported by *PPiOS-Rename*. *PPiOS-Rename* **does not work** on projects with **any** Swift code.

Source/class-dump.m

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -613,14 +613,17 @@ int main(int argc, char *argv[])
613613
static 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+
NSRange replaceablePart = NSMakeRange(start, [sdkRoot length] - start);
621+
for (NSString *simulator in [NSArray arrayWithObjects:@"iPhoneOS.platform/Library/Developer", @"iPhoneOS.platform/Developer/Library", nil]) {
622+
NSString *candidate = [simulator stringByAppendingString:@"/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot"];
623+
NSString *root = [sdkRoot stringByReplacingCharactersInRange:replaceablePart withString:candidate];
624+
if ([fileManager fileExistsAtPath:root]) {
625+
return root;
626+
}
624627
}
625628
}
626629

0 commit comments

Comments
 (0)