@@ -56,7 +56,7 @@ static void shutdownSimulator(NSString* simulatorId)
5656 [shutdownTask waitUntilExit ];
5757}
5858
59- static NSArray * simulatorDevicesList ()
59+ static NSArray * simulatorDevicesList (void )
6060{
6161 LNLog (LNLogLevelDebug, @" Obtaining simulator device list" );
6262
@@ -114,7 +114,7 @@ static void shutdownSimulator(NSString* simulatorId)
114114 return allDevices;
115115}
116116
117- static NSPredicate * predicateByBooted ()
117+ static NSPredicate * predicateByBooted (void )
118118{
119119 return [NSPredicate predicateWithFormat: @" state ==[c] %@" , @" Booted" ];
120120}
@@ -274,6 +274,7 @@ static BOOL performPermissionsPass(NSString* permissionsArgument, NSString* simu
274274 @" speech" : @" kTCCServiceSpeechRecognition" ,
275275 @" userTracking" : @" kTCCServiceUserTracking" ,
276276 };
277+ NSURL *runtimeBundleURL = [NSURL fileURLWithPath: simulator[@" os" ][@" bundlePath" ]];
277278
278279 NSArray <NSString *>* parsedArguments = [permissionsArgument componentsSeparatedByString: @" ," ];
279280
@@ -317,7 +318,7 @@ static BOOL performPermissionsPass(NSString* permissionsArgument, NSString* simu
317318 {
318319 assertStringInArrayValues (value, @[@" never" , @" always" , @" inuse" , @" unset" ], -10 , [NSString stringWithFormat: @" Error: Illegal value “%@ ” parsed for permission “%@ ”." , value, permission]);
319320
320- success = [SetLocationPermission setLocationPermission: value forBundleIdentifier: bundleIdentifier simulatorIdentifier: simulatorIdentifier error: &err];
321+ success = [SetLocationPermission setLocationPermission: value forBundleIdentifier: bundleIdentifier simulatorIdentifier: simulatorIdentifier runtimeBundleURL: runtimeBundleURL error: &err];
321322
322323 needsSpringBoardRestart |= NO ;
323324 }
@@ -640,7 +641,8 @@ int main(int argc, const char* argv[]) {
640641 {
641642 [filteredSimulators enumerateObjectsUsingBlock: ^(NSDictionary * _Nonnull simulator, NSUInteger idx, BOOL * _Nonnull stop) {
642643 NSString * simulatorId = simulator[@" udid" ];
643-
644+ NSURL *runtimeBundleURL = [NSURL fileURLWithPath: simulator[@" os" ][@" bundlePath" ]];
645+
644646 NSString * title = [NSString stringWithFormat: @" %@ (%@ , %@ )" , simulator[@" name" ], simulatorId, simulator[@" state" ]];
645647 NSString * underline = [@" " stringByPaddingToLength: title.length withString: @" -" startingAtIndex: 0 ];
646648 LNLog (LNLogLevelStdOut, @" %@ \n %@ " , title, underline);
@@ -676,13 +678,13 @@ int main(int argc, const char* argv[]) {
676678 simPaths[@" TCC Database Path" ] = [url URLByAppendingPathComponent: @" TCC/TCC.db" ].path ;
677679 }
678680
679- url = [SetLocationPermission locationdURL ];
681+ url = [SetLocationPermission locationdURLForRuntimeBundleURL: runtimeBundleURL ];
680682 if (url.path != nil )
681683 {
682684 simPaths[@" locationd Daemon Info Plist Path" ] = url.path ;
683685 }
684686
685- url = securitydURL ();
687+ url = securitydURL (runtimeBundleURL );
686688 if (url.path != nil )
687689 {
688690 simPaths[@" securityd Daemon Info Plist Path" ] = url.path ;
@@ -742,6 +744,7 @@ int main(int argc, const char* argv[]) {
742744
743745 [filteredSimulators enumerateObjectsUsingBlock: ^(NSDictionary * _Nonnull simulator, NSUInteger idx, BOOL * _Nonnull stop) {
744746 NSString * simulatorId = simulator[@" udid" ];
747+ NSURL *runtimeBundleURL = [NSURL fileURLWithPath: simulator[@" os" ][@" bundlePath" ]];
745748
746749 BOOL needsSimShutdown = NO ;
747750 if ([simulator[@" state" ] isEqualToString: @" Shutdown" ] && [settings objectForKey: @" setPermissions" ] != nil )
@@ -769,14 +772,14 @@ int main(int argc, const char* argv[]) {
769772
770773 if ([settings boolForKey: @" clearKeychain" ])
771774 {
772- performClearKeychainPass (simulatorId);
775+ performClearKeychainPass (simulatorId, runtimeBundleURL );
773776
774777 needsSpringBoardRestart = YES ;
775778 }
776779
777780 if ([settings boolForKey: @" clearMedia" ])
778781 {
779- performClearMediaPass (simulatorId);
782+ performClearMediaPass (simulatorId, runtimeBundleURL );
780783
781784 needsSpringBoardRestart = YES ;
782785 }
0 commit comments