|
11 | 11 |
|
12 | 12 | static void startStopLocationdCtl(NSString* simulatorId, BOOL stop) |
13 | 13 | { |
14 | | - NSFileManager *fileManager = [NSFileManager defaultManager]; |
15 | | - //New Simulator Runtime location for Xcode 9 |
16 | | - NSURL *devTools = [[SimUtils developerURL] URLByAppendingPathComponent:@"Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/LaunchDaemons/com.apple.locationd.plist"]; |
17 | | - |
18 | | - if ([fileManager fileExistsAtPath:devTools.path] == NO) |
| 14 | + NSFileManager *fileManager = [NSFileManager defaultManager]; |
| 15 | + NSURL* developerTools = [SimUtils developerURL]; |
| 16 | + //New Simulator Runtime location for Xcode 9 |
| 17 | + NSURL *locationdDaemonURL = [developerTools URLByAppendingPathComponent:@"Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/LaunchDaemons/com.apple.locationd.plist"]; |
| 18 | + |
| 19 | + if ([fileManager fileExistsAtPath:locationdDaemonURL.path] == NO) |
19 | 20 | { |
20 | | - devTools = [[SimUtils developerURL] URLByAppendingPathComponent:@"Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/LaunchDaemons/com.apple.locationd.plist"]; |
21 | | - } |
| 21 | + locationdDaemonURL = [developerTools URLByAppendingPathComponent:@"Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/LaunchDaemons/com.apple.locationd.plist"]; |
| 22 | + } |
22 | 23 |
|
23 | | - if ([fileManager fileExistsAtPath:devTools.path] == NO) |
| 24 | + if ([fileManager fileExistsAtPath:locationdDaemonURL.path] == NO) |
24 | 25 | { |
25 | | - devTools = [[SimUtils developerURL] URLByAppendingPathComponent:@"Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/LaunchDaemons/com.apple.locationd.plist"]; |
26 | | - } |
27 | | - |
| 26 | + locationdDaemonURL = [developerTools URLByAppendingPathComponent:@"Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/LaunchDaemons/com.apple.locationd.plist"]; |
| 27 | + } |
| 28 | + |
28 | 29 | NSTask* rebootTask = [NSTask new]; |
29 | 30 | rebootTask.launchPath = [SimUtils xcrunURL].path; |
30 | | - rebootTask.arguments = @[@"simctl", @"spawn", simulatorId, @"launchctl", stop ? @"unload" : @"load", devTools.path]; |
| 31 | + rebootTask.arguments = @[@"simctl", @"spawn", simulatorId, @"launchctl", stop ? @"unload" : @"load", locationdDaemonURL.path]; |
31 | 32 | [rebootTask launch]; |
32 | 33 | [rebootTask waitUntilExit]; |
33 | 34 | } |
|
0 commit comments