@@ -20,14 +20,16 @@ @implementation XCUIApplication (GREYEnvironment)
20
20
21
21
- (void )grey_configureApplicationForLaunch {
22
22
NSMutableDictionary <NSString *, NSString *> *mutableEnv = [self .launchEnvironment mutableCopy ];
23
- NSString *insertionKey = @" DYLD_INSERT_LIBRARIES" ;
24
- NSString *insertionValue = @" @executable_path/Frameworks/AppFramework.framework/AppFramework" ;
25
- NSString *alreadyExistingValue = [mutableEnv valueForKey: insertionKey];
26
- NSArray <NSString *> *existingValues = [alreadyExistingValue componentsSeparatedByString: @" :" ];
27
- if (existingValues && ![existingValues containsObject: insertionValue]) {
28
- insertionValue = [NSString stringWithFormat: @" %@ :%@ " , alreadyExistingValue, insertionValue];
23
+ if (![mutableEnv[@" EG_SKIP_INSERT_LIBRARIES" ] isEqualToString: @" YES" ]) {
24
+ NSString *insertionKey = @" DYLD_INSERT_LIBRARIES" ;
25
+ NSString *insertionValue = @" @executable_path/Frameworks/AppFramework.framework/AppFramework" ;
26
+ NSString *alreadyExistingValue = [mutableEnv valueForKey: insertionKey];
27
+ NSArray <NSString *> *existingValues = [alreadyExistingValue componentsSeparatedByString: @" :" ];
28
+ if (existingValues && ![existingValues containsObject: insertionValue]) {
29
+ insertionValue = [NSString stringWithFormat: @" %@ :%@ " , alreadyExistingValue, insertionValue];
30
+ }
31
+ [mutableEnv setObject: insertionValue forKey: insertionKey];
29
32
}
30
- [mutableEnv setObject: insertionValue forKey: insertionKey];
31
33
32
34
// Pass in this flag so logging is enabled for the application process for both NSLog and OSLog.
33
35
mutableEnv[@" OS_ACTIVITY_DT_MODE" ] = @" YES" ;
0 commit comments