Skip to content

Commit 2d45807

Browse files
committed
Code styling
1 parent 940234e commit 2d45807

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

applesimutils/applesimutils/SetLocationPermission.m

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,24 @@
1111

1212
static void startStopLocationdCtl(NSString* simulatorId, BOOL stop)
1313
{
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)
1920
{
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+
}
2223

23-
if ([fileManager fileExistsAtPath:devTools.path] == NO)
24+
if ([fileManager fileExistsAtPath:locationdDaemonURL.path] == NO)
2425
{
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+
2829
NSTask* rebootTask = [NSTask new];
2930
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];
3132
[rebootTask launch];
3233
[rebootTask waitUntilExit];
3334
}

0 commit comments

Comments
 (0)