appium-webdriveragent 9.15.2 → 9.15.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [9.15.3](https://github.com/appium/WebDriverAgent/compare/v9.15.2...v9.15.3) (2025-08-12)
|
|
2
|
+
|
|
3
|
+
### Miscellaneous Chores
|
|
4
|
+
|
|
5
|
+
* Cache application instances for their PIDs ([#1049](https://github.com/appium/WebDriverAgent/issues/1049)) ([e9cbf64](https://github.com/appium/WebDriverAgent/commit/e9cbf640c21243c304b476a497f33802e0501a7d))
|
|
6
|
+
|
|
1
7
|
## [9.15.2](https://github.com/appium/WebDriverAgent/compare/v9.15.1...v9.15.2) (2025-08-04)
|
|
2
8
|
|
|
3
9
|
### Miscellaneous Chores
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
<key>CFBundlePackageType</key>
|
|
16
16
|
<string>FMWK</string>
|
|
17
17
|
<key>CFBundleShortVersionString</key>
|
|
18
|
-
<string>9.15.
|
|
18
|
+
<string>9.15.3</string>
|
|
19
19
|
<key>CFBundleSignature</key>
|
|
20
20
|
<string>????</string>
|
|
21
21
|
<key>CFBundleVersion</key>
|
|
22
|
-
<string>9.15.
|
|
22
|
+
<string>9.15.3</string>
|
|
23
23
|
<key>NSPrincipalClass</key>
|
|
24
24
|
<string/>
|
|
25
25
|
</dict>
|
|
@@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
43
43
|
attributes:(NSArray *)attributes
|
|
44
44
|
error:(NSError**)error;
|
|
45
45
|
|
|
46
|
-
- (XCUIApplication *)monitoredApplicationWithProcessIdentifier:(int)pid;
|
|
46
|
+
- (nullable XCUIApplication *)monitoredApplicationWithProcessIdentifier:(int)pid;
|
|
47
47
|
|
|
48
48
|
@end
|
|
49
49
|
|
|
@@ -14,9 +14,16 @@
|
|
|
14
14
|
#import "FBMacros.h"
|
|
15
15
|
#import "XCAXClient_iOS+FBSnapshotReqParams.h"
|
|
16
16
|
#import "XCUIDevice.h"
|
|
17
|
+
#import "XCUIApplication.h"
|
|
17
18
|
|
|
18
19
|
static id FBAXClient = nil;
|
|
19
20
|
|
|
21
|
+
@interface FBXCAXClientProxy ()
|
|
22
|
+
|
|
23
|
+
@property (nonatomic) NSMutableDictionary<NSNumber *, XCUIApplication *> *appsCache;
|
|
24
|
+
|
|
25
|
+
@end
|
|
26
|
+
|
|
20
27
|
@implementation FBXCAXClientProxy
|
|
21
28
|
|
|
22
29
|
+ (instancetype)sharedClient
|
|
@@ -25,6 +32,7 @@ static id FBAXClient = nil;
|
|
|
25
32
|
static dispatch_once_t onceToken;
|
|
26
33
|
dispatch_once(&onceToken, ^{
|
|
27
34
|
instance = [[self alloc] init];
|
|
35
|
+
instance.appsCache = [NSMutableDictionary dictionary];
|
|
28
36
|
FBAXClient = [XCUIDevice.sharedDevice accessibilityInterface];
|
|
29
37
|
});
|
|
30
38
|
return instance;
|
|
@@ -85,7 +93,28 @@ static id FBAXClient = nil;
|
|
|
85
93
|
|
|
86
94
|
- (XCUIApplication *)monitoredApplicationWithProcessIdentifier:(int)pid
|
|
87
95
|
{
|
|
88
|
-
|
|
96
|
+
NSMutableSet *terminatedAppIds = [NSMutableSet set];
|
|
97
|
+
for (NSNumber *appPid in self.appsCache) {
|
|
98
|
+
if (![self.appsCache[appPid] running]) {
|
|
99
|
+
[terminatedAppIds addObject:appPid];
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
for (NSNumber *appPid in terminatedAppIds) {
|
|
103
|
+
[self.appsCache removeObjectForKey:appPid];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
XCUIApplication *result = [self.appsCache objectForKey:@(pid)];
|
|
107
|
+
if (nil != result) {
|
|
108
|
+
return result;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
XCUIApplication *app = [[FBAXClient applicationProcessTracker]
|
|
112
|
+
monitoredApplicationWithProcessIdentifier:pid];
|
|
113
|
+
if (nil == app) {
|
|
114
|
+
return nil;
|
|
115
|
+
}
|
|
116
|
+
[self.appsCache setObject:app forKey:@(pid)];
|
|
117
|
+
return app;
|
|
89
118
|
}
|
|
90
119
|
|
|
91
120
|
@end
|