appium-webdriveragent 16.11.3 → 16.12.0

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,19 @@
1
+ ## [16.12.0](https://github.com/appium/WebDriverAgent/compare/v16.11.4...v16.12.0) (2026-09-01)
2
+
3
+ ### Features
4
+
5
+ * add get screens endpoint ([#1242](https://github.com/appium/WebDriverAgent/issues/1242)) ([55808de](https://github.com/appium/WebDriverAgent/commit/55808de21df801c69991cd0de66ee7eeaac3407e))
6
+
7
+ ### Bug Fixes
8
+
9
+ * scope xcodebuild process kill to this package's own processes ([#1244](https://github.com/appium/WebDriverAgent/issues/1244)) ([988f309](https://github.com/appium/WebDriverAgent/commit/988f3097876f627a48b38a242958c755c429db95))
10
+
11
+ ## [16.11.4](https://github.com/appium/WebDriverAgent/compare/v16.11.3...v16.11.4) (2026-08-30)
12
+
13
+ ### Bug Fixes
14
+
15
+ * prevent a stale teardown from affecting a newer session generation ([#1231](https://github.com/appium/WebDriverAgent/issues/1231)) ([83642a1](https://github.com/appium/WebDriverAgent/commit/83642a11218fd2b2801af0a04d3b253125246bd7))
16
+
1
17
  ## [16.11.3](https://github.com/appium/WebDriverAgent/compare/v16.11.2...v16.11.3) (2026-08-30)
2
18
 
3
19
  ### Miscellaneous Chores
@@ -53,6 +53,8 @@
53
53
  [[FBRoute GET:@"/wda/locked"] respondWithTarget:self action:@selector(handleIsLocked:)],
54
54
  [[FBRoute GET:@"/wda/screen"] respondWithTarget:self action:@selector(handleGetScreen:)],
55
55
  [[FBRoute GET:@"/wda/screen"].withoutSession respondWithTarget:self action:@selector(handleGetScreen:)],
56
+ [[FBRoute GET:@"/wda/screens"].standalone respondWithTarget:self action:@selector(handleGetScreens:)],
57
+ [[FBRoute GET:@"/wda/screens"].withoutSession.standalone respondWithTarget:self action:@selector(handleGetScreens:)],
56
58
  [[FBRoute GET:@"/wda/activeAppInfo"] respondWithTarget:self action:@selector(handleActiveAppInfo:)],
57
59
  [[FBRoute GET:@"/wda/activeAppInfo"].withoutSession respondWithTarget:self action:@selector(handleActiveAppInfo:)],
58
60
  #if !TARGET_OS_TV && !TARGET_OS_WATCH // tvOS/watchOS do not provide relevant APIs
@@ -179,6 +181,16 @@
179
181
  });
180
182
  }
181
183
 
184
+ + (id<FBResponsePayload>)handleGetScreens:(FBRouteRequest *)request
185
+ {
186
+ NSError *error;
187
+ NSArray<NSDictionary<NSString *, id> *> *screens = [FBScreen screensWithError:&error];
188
+ if (nil == screens) {
189
+ return FBResponseWithUnknownError(error);
190
+ }
191
+ return FBResponseWithObject(screens);
192
+ }
193
+
182
194
  + (id<FBResponsePayload>)handleLock:(FBRouteRequest *)request
183
195
  {
184
196
  NSError *error;
@@ -15,11 +15,11 @@
15
15
  <key>CFBundlePackageType</key>
16
16
  <string>FMWK</string>
17
17
  <key>CFBundleShortVersionString</key>
18
- <string>16.11.3</string>
18
+ <string>16.12.0</string>
19
19
  <key>CFBundleSignature</key>
20
20
  <string>????</string>
21
21
  <key>CFBundleVersion</key>
22
- <string>16.11.3</string>
22
+ <string>16.12.0</string>
23
23
  <key>NSPrincipalClass</key>
24
24
  <string/>
25
25
  </dict>
@@ -44,6 +44,15 @@ NS_ASSUME_NONNULL_BEGIN
44
44
  */
45
45
  - (void)reset;
46
46
 
47
+ /**
48
+ Resets the container, but only if it still keeps the given promise. The comparison and the
49
+ reset are performed atomically, so a promise stored concurrently is never dropped.
50
+
51
+ @param screenRecordingPromise the promise the caller expects to be still active
52
+ @return YES if the container has been reset
53
+ */
54
+ - (BOOL)resetIfPromiseIs:(FBScreenRecordingPromise *)screenRecordingPromise;
55
+
47
56
  /**
48
57
  Transforms the container content to a dictionary.
49
58
 
@@ -36,23 +36,39 @@
36
36
  fps:(NSUInteger)fps
37
37
  codec:(long long)codec;
38
38
  {
39
- self.fps = fps;
40
- self.codec = codec;
41
- self.screenRecordingPromise = screenRecordingPromise;
42
- self.startedAt = @([NSDate.date timeIntervalSince1970]);
39
+ @synchronized (self) {
40
+ self.fps = fps;
41
+ self.codec = codec;
42
+ self.screenRecordingPromise = screenRecordingPromise;
43
+ self.startedAt = @([NSDate.date timeIntervalSince1970]);
44
+ }
43
45
  }
44
46
 
45
47
  - (void)reset;
46
48
  {
47
- self.fps = 0;
48
- self.codec = 0;
49
- if (nil != self.screenRecordingPromise) {
50
- [XCTContext runActivityNamed:@"Video Cleanup" block:^(id<XCTActivity> activity){
51
- [activity addAttachment:(XCTAttachment *)self.screenRecordingPromise.nativePromise];
52
- }];
53
- self.screenRecordingPromise = nil;
49
+ @synchronized (self) {
50
+ self.fps = 0;
51
+ self.codec = 0;
52
+ if (nil != self.screenRecordingPromise) {
53
+ [XCTContext runActivityNamed:@"Video Cleanup" block:^(id<XCTActivity> activity){
54
+ [activity addAttachment:(XCTAttachment *)self.screenRecordingPromise.nativePromise];
55
+ }];
56
+ self.screenRecordingPromise = nil;
57
+ }
58
+ self.startedAt = nil;
59
+ }
60
+ }
61
+
62
+ - (BOOL)resetIfPromiseIs:(FBScreenRecordingPromise *)screenRecordingPromise
63
+ {
64
+ // @synchronized is recursive, so -reset may take the very same lock again below.
65
+ @synchronized (self) {
66
+ if (self.screenRecordingPromise != screenRecordingPromise) {
67
+ return NO;
68
+ }
69
+ [self reset];
70
+ return YES;
54
71
  }
55
- self.startedAt = nil;
56
72
  }
57
73
 
58
74
  - (nullable NSDictionary *)toDictionary
@@ -54,6 +54,9 @@ extern NSString* const FBSessionWasKilledNotification;
54
54
  Kills the active session, if any, and blocks until its teardown - including one already started
55
55
  by a concurrent caller - is fully finished. Call this before preparing/launching a replacement
56
56
  application, so it can't race a still-in-progress termination of the outgoing one.
57
+
58
+ @throws FBSessionCreationException if the outgoing application's termination is still in flight
59
+ after the wait, since a replacement must never start while that termination can still land.
57
60
  */
58
61
  + (void)killActiveSessionAndWaitForTeardown;
59
62
 
@@ -50,7 +50,7 @@ NSString *const FBSessionWasKilledNotification = @"FBSessionWasKilledNotificatio
50
50
  @property (nonatomic, readwrite) NSMutableDictionary<NSNumber *, NSMutableDictionary<NSString *, NSNumber *> *> *elementsVisibilityCache;
51
51
 
52
52
  - (BOOL)fb_isTestedApplicationSameAsSystemAppWithTimeout:(NSTimeInterval)timeout;
53
- - (void)fb_terminateTestedApplicationWithTimeout:(NSTimeInterval)timeout;
53
+ - (void)fb_terminateTestedApplicationWithTimeout:(NSTimeInterval)timeout generation:(NSUInteger)generation;
54
54
  @end
55
55
 
56
56
  @interface FBSession (FBAlertsMonitorDelegate)
@@ -100,11 +100,20 @@ NSString *const FBSessionWasKilledNotification = @"FBSessionWasKilledNotificatio
100
100
 
101
101
  @implementation FBSession
102
102
 
103
+ // Guarded, together with the two counters below, by +teardownCondition.
103
104
  static FBSession *_activeSession = nil;
104
105
  // Class-level, not per-instance: a caller that finds _activeSession already nil (a concurrent
105
106
  // -kill beat it there) still needs to know whether that -kill's teardown is done, since it cleared
106
107
  // the pointer before running it. See +waitForActiveTeardownWithTimeout:.
107
- static BOOL _isTeardownInProgress = NO;
108
+ // A count, not a flag: the bounded wait below lets teardowns overlap, so one of them finishing
109
+ // must not wake waiters while another still runs.
110
+ static NSUInteger _activeTeardownCount = 0;
111
+ // Bumped once a caller owns the device, before it launches anything; a teardown still running past
112
+ // the bounded wait re-checks it before touching process-wide state.
113
+ static NSUInteger _sessionGeneration = 0;
114
+ // Teardowns that have claimed the current generation and are committed to terminating the app.
115
+ // The generation bump waits for these to drain, so a claim and a bump can never interleave.
116
+ static NSUInteger _committedTerminationCount = 0;
108
117
 
109
118
  + (NSCondition *)teardownCondition
110
119
  {
@@ -116,25 +125,29 @@ static BOOL _isTeardownInProgress = NO;
116
125
  return condition;
117
126
  }
118
127
 
119
- // Waits (bounded) for any -kill teardown currently in progress to finish.
128
+ // Waits (bounded) for every -kill teardown currently in progress to finish.
120
129
  + (void)waitForActiveTeardownWithTimeout:(NSTimeInterval)timeout
121
130
  {
122
131
  NSCondition *condition = self.teardownCondition;
123
132
  [condition lock];
124
133
  NSDate *deadline = [NSDate dateWithTimeIntervalSinceNow:timeout];
125
- while (_isTeardownInProgress && [condition waitUntilDate:deadline]) {
134
+ while (_activeTeardownCount > 0 && [condition waitUntilDate:deadline]) {
126
135
  }
127
136
  [condition unlock];
128
137
  }
129
138
 
130
139
  + (instancetype)activeSession
131
140
  {
132
- return _activeSession;
141
+ NSCondition *condition = self.teardownCondition;
142
+ [condition lock];
143
+ FBSession *session = _activeSession;
144
+ [condition unlock];
145
+ return session;
133
146
  }
134
147
 
135
148
  + (void)killActiveSessionAndWaitForTeardown
136
149
  {
137
- FBSession *session = _activeSession;
150
+ FBSession *session = self.activeSession;
138
151
  if (nil != session) {
139
152
  // Runs the real teardown synchronously if this call wins the race in -kill, or waits for
140
153
  // whoever did to finish if it lost - either way, blocks until torn down.
@@ -144,12 +157,69 @@ static BOOL _isTeardownInProgress = NO;
144
157
  // be mid-teardown - wait for it, so we don't launch a replacement app too early.
145
158
  [self waitForActiveTeardownWithTimeout:FB_KILL_WAIT_TIMEOUT_SEC];
146
159
  }
160
+ // Claimed before the caller launches its replacement app: if the bounded wait expired with a
161
+ // teardown still running, that teardown must be stale by the time the new app exists.
162
+ NSCondition *condition = self.teardownCondition;
163
+ [condition lock];
164
+ // A committed -terminate cannot be revoked, so the next generation must never be handed out
165
+ // while one is in flight - give up on the new session instead of racing it.
166
+ NSDate *deadline = [NSDate dateWithTimeIntervalSinceNow:FB_APP_TERMINATE_TIMEOUT_SEC];
167
+ while (_committedTerminationCount > 0 && [condition waitUntilDate:deadline]) {
168
+ }
169
+ BOOL isTerminationPending = _committedTerminationCount > 0;
170
+ if (!isTerminationPending) {
171
+ _sessionGeneration++;
172
+ }
173
+ [condition unlock];
174
+ if (isTerminationPending) {
175
+ NSString *reason = [NSString stringWithFormat:@"The termination of a previous session's application is still in progress after %@ seconds. Please retry the session creation later", @(FB_APP_TERMINATE_TIMEOUT_SEC)];
176
+ @throw [NSException exceptionWithName:FBSessionCreationException reason:reason userInfo:nil];
177
+ }
147
178
  }
148
179
 
149
180
  + (void)markSessionActive:(FBSession *)session
150
181
  {
151
182
  [self killActiveSessionAndWaitForTeardown];
183
+ NSCondition *condition = self.teardownCondition;
184
+ [condition lock];
152
185
  _activeSession = session;
186
+ [condition unlock];
187
+ }
188
+
189
+ // Validates and claims `generation` in one critical section, so no replacement can be handed the
190
+ // next generation until the matching +endTermination. NO means this teardown is already stale.
191
+ + (BOOL)beginTerminationForGeneration:(NSUInteger)generation
192
+ {
193
+ NSCondition *condition = self.teardownCondition;
194
+ [condition lock];
195
+ BOOL isCurrent = generation == _sessionGeneration;
196
+ if (isCurrent) {
197
+ _committedTerminationCount++;
198
+ }
199
+ [condition unlock];
200
+ return isCurrent;
201
+ }
202
+
203
+ + (void)endTermination
204
+ {
205
+ NSCondition *condition = self.teardownCondition;
206
+ [condition lock];
207
+ _committedTerminationCount--;
208
+ [condition broadcast];
209
+ [condition unlock];
210
+ }
211
+
212
+ // Read in the same critical section that validates the generation: a replacement would have bumped
213
+ // the generation before storing anything, so a promise captured here can never be its.
214
+ + (FBScreenRecordingPromise *)activeScreenRecordingForGeneration:(NSUInteger)generation
215
+ {
216
+ NSCondition *condition = self.teardownCondition;
217
+ [condition lock];
218
+ FBScreenRecordingPromise *promise = generation == _sessionGeneration
219
+ ? FBScreenRecordingContainer.sharedInstance.screenRecordingPromise
220
+ : nil;
221
+ [condition unlock];
222
+ return promise;
153
223
  }
154
224
 
155
225
  + (instancetype)sessionWithIdentifier:(NSString *)identifier
@@ -157,10 +227,9 @@ static BOOL _isTeardownInProgress = NO;
157
227
  if (!identifier) {
158
228
  return nil;
159
229
  }
160
- if (![identifier isEqualToString:_activeSession.identifier]) {
161
- return nil;
162
- }
163
- return _activeSession;
230
+ // A single snapshot: reading the global twice could validate one session and return another.
231
+ FBSession *session = self.activeSession;
232
+ return [identifier isEqualToString:session.identifier] ? session : nil;
164
233
  }
165
234
 
166
235
  + (instancetype)initWithApplication:(XCUIApplication *)application
@@ -220,13 +289,20 @@ static BOOL _isTeardownInProgress = NO;
220
289
  // DELETE /session and session creation can now run concurrently, so a session already
221
290
  // superseded by a newer one can still reach here via a stale reference. Check-and-clear must be
222
291
  // atomic, else a belated -kill could null out the new session's pointer instead of its own.
292
+ NSCondition *teardownCondition = self.class.teardownCondition;
223
293
  BOOL wasActive;
224
- @synchronized (self.class) {
225
- wasActive = (self == _activeSession);
226
- if (wasActive) {
227
- _activeSession = nil;
228
- }
294
+ NSUInteger generation;
295
+ [teardownCondition lock];
296
+ wasActive = (self == _activeSession);
297
+ // Captured so the teardown steps below can tell whether a replacement has claimed the device.
298
+ generation = _sessionGeneration;
299
+ if (wasActive) {
300
+ _activeSession = nil;
301
+ // Registered in the same critical section as the clear above, else a concurrent session
302
+ // creation could observe neither an active session nor a teardown and skip its wait.
303
+ _activeTeardownCount++;
229
304
  }
305
+ [teardownCondition unlock];
230
306
  if (!wasActive) {
231
307
  // Someone else is already tearing this session down - wait for that to finish (bounded), so
232
308
  // we don't act as if it's gone (e.g. launch a new app) while its -terminate is still in flight.
@@ -234,24 +310,23 @@ static BOOL _isTeardownInProgress = NO;
234
310
  return;
235
311
  }
236
312
 
237
- NSCondition *teardownCondition = self.class.teardownCondition;
238
- [teardownCondition lock];
239
- _isTeardownInProgress = YES;
240
- [teardownCondition unlock];
241
-
242
313
  @try {
243
314
  // Posted before teardown so pending HTTP requests for this session can stop waiting sooner.
244
315
  [NSNotificationCenter.defaultCenter postNotificationName:FBSessionWasKilledNotification object:self];
245
316
 
246
317
  [self disableAlertsMonitor];
247
318
 
248
- FBScreenRecordingPromise *activeScreenRecording = FBScreenRecordingContainer.sharedInstance.screenRecordingPromise;
319
+ // The container is process-wide, so only act on a promise captured while this teardown still
320
+ // owned the generation - nil here means it is stale and must leave the recording alone.
321
+ FBScreenRecordingPromise *activeScreenRecording = [self.class activeScreenRecordingForGeneration:generation];
249
322
  if (nil != activeScreenRecording) {
250
323
  NSError *error;
251
324
  if (![FBXCTestDaemonsProxy stopScreenRecordingWithUUID:activeScreenRecording.identifier error:&error]) {
252
325
  [FBLogger logFmt:@"%@", error];
253
326
  }
254
- [FBScreenRecordingContainer.sharedInstance reset];
327
+ // Identity, not generation: the stop above may outlast a replacement storing its own promise.
328
+ // Compare-and-reset, so that replacement's store cannot land between the check and the reset.
329
+ [FBScreenRecordingContainer.sharedInstance resetIfPromiseIs:activeScreenRecording];
255
330
  }
256
331
 
257
332
  if (nil != self.testedApplication
@@ -259,13 +334,14 @@ static BOOL _isTeardownInProgress = NO;
259
334
  && self.testedApplication.running
260
335
  && ![self fb_isTestedApplicationSameAsSystemAppWithTimeout:FB_IS_SYSTEM_APP_CHECK_TIMEOUT_SEC]) {
261
336
  // Blocks until the app is either actually terminated or durably given up on (never left
262
- // pending) - see -fb_terminateTestedApplicationWithTimeout: - so it's safe to report this
263
- // teardown as finished as soon as this returns.
264
- [self fb_terminateTestedApplicationWithTimeout:FB_APP_TERMINATE_TIMEOUT_SEC];
337
+ // pending) - see -fb_terminateTestedApplicationWithTimeout:generation: - so it's safe to
338
+ // report this teardown as finished as soon as this returns.
339
+ [self fb_terminateTestedApplicationWithTimeout:FB_APP_TERMINATE_TIMEOUT_SEC generation:generation];
265
340
  }
266
341
  } @finally {
267
342
  [teardownCondition lock];
268
- _isTeardownInProgress = NO;
343
+ _activeTeardownCount--;
344
+ // Unconditional: waiters re-check the count, so a wake-up mid-teardown just puts them back.
269
345
  [teardownCondition broadcast];
270
346
  [teardownCondition unlock];
271
347
  }
@@ -394,7 +470,7 @@ static BOOL _isTeardownInProgress = NO;
394
470
  // `timeout` - but a "given up on" call must never still terminate whatever's running by the time
395
471
  // main gets to it (e.g. a replacement session's app), so cancellation and the actual terminate
396
472
  // call share a lock: whichever gets there first - the dispatched block, or the timeout - wins.
397
- - (void)fb_terminateTestedApplicationWithTimeout:(NSTimeInterval)timeout
473
+ - (void)fb_terminateTestedApplicationWithTimeout:(NSTimeInterval)timeout generation:(NSUInteger)generation
398
474
  {
399
475
  XCUIApplication *application = self.testedApplication;
400
476
  NSObject *lock = [NSObject new];
@@ -402,11 +478,16 @@ static BOOL _isTeardownInProgress = NO;
402
478
  dispatch_semaphore_t sem = dispatch_semaphore_create(0);
403
479
  dispatch_async(dispatch_get_main_queue(), ^{
404
480
  @synchronized (lock) {
405
- if (isAllowedToTerminate) {
481
+ // Re-checked here, not before dispatching: this block can sit on a busy main queue past the
482
+ // teardown wait, and a replacement usually runs the same bundle ID as the app to terminate.
483
+ // The claim is held across -terminate, so no replacement can take the next generation mid-call.
484
+ if (isAllowedToTerminate && [self.class beginTerminationForGeneration:generation]) {
406
485
  @try {
407
486
  [application terminate];
408
487
  } @catch (NSException *e) {
409
488
  [FBLogger logFmt:@"%@", e.description];
489
+ } @finally {
490
+ [self.class endTermination];
410
491
  }
411
492
  }
412
493
  }
@@ -12,6 +12,11 @@ NS_ASSUME_NONNULL_BEGIN
12
12
 
13
13
  @interface FBScreen : NSObject
14
14
 
15
+ /**
16
+ Information about all displays available to the device
17
+ */
18
+ + (nullable NSArray<NSDictionary<NSString *, id> *> *)screensWithError:(NSError **)error;
19
+
15
20
  /**
16
21
  The identifier of the main device's display
17
22
  */
@@ -9,10 +9,37 @@
9
9
  #import "FBScreen.h"
10
10
  #import "XCUIElement+FBIsVisible.h"
11
11
  #import "FBXCodeCompatibility.h"
12
+ #import "XCUIDevice.h"
12
13
  #import "XCUIScreen.h"
13
14
 
14
15
  @implementation FBScreen
15
16
 
17
+ + (nullable NSArray<NSDictionary<NSString *, id> *> *)screensWithError:(NSError **)error
18
+ {
19
+ NSArray<XCUIScreen *> *screens = [XCUIDevice.sharedDevice screensOrError:error];
20
+ if (nil == screens) {
21
+ return nil;
22
+ }
23
+
24
+ NSMutableArray<NSDictionary<NSString *, id> *> *result = [NSMutableArray arrayWithCapacity:screens.count];
25
+ for (XCUIScreen *screen in screens) {
26
+ CGRect bounds = screen.bounds;
27
+ [result addObject:@{
28
+ @"displayId": @(screen.displayID),
29
+ @"isMain": @(screen.isMainScreen),
30
+ @"scale": @(screen.scale),
31
+ @"bounds": @{
32
+ @"x": @(bounds.origin.x),
33
+ @"y": @(bounds.origin.y),
34
+ @"width": @(bounds.size.width),
35
+ @"height": @(bounds.size.height),
36
+ },
37
+ @"traits": @(screen.traits),
38
+ }];
39
+ }
40
+ return result.copy;
41
+ }
42
+
16
43
  + (long long)displayID
17
44
  {
18
45
  return XCUIScreen.mainScreen.displayID;
@@ -27,6 +27,29 @@
27
27
  XCTAssertGreaterThanOrEqual([FBScreen displayID], 0LL);
28
28
  }
29
29
 
30
+ - (void)testScreens
31
+ {
32
+ NSError *error = nil;
33
+ NSArray<NSDictionary<NSString *, id> *> *screens = [FBScreen screensWithError:&error];
34
+
35
+ XCTAssertNotNil(screens);
36
+ XCTAssertNil(error);
37
+ XCTAssertGreaterThan(screens.count, 0UL);
38
+
39
+ NSDictionary<NSString *, id> *mainScreen = nil;
40
+ for (NSDictionary<NSString *, id> *screen in screens) {
41
+ if ([screen[@"isMain"] boolValue]) {
42
+ mainScreen = screen;
43
+ break;
44
+ }
45
+ }
46
+ XCTAssertNotNil(mainScreen);
47
+ XCTAssertEqualObjects(mainScreen[@"displayId"], @([FBScreen displayID]));
48
+ XCTAssertNotNil(mainScreen[@"scale"]);
49
+ XCTAssertNotNil(mainScreen[@"bounds"]);
50
+ XCTAssertNotNil(mainScreen[@"traits"]);
51
+ }
52
+
30
53
  - (void)testScreenScale
31
54
  {
32
55
  XCTAssertTrue([FBScreen scale] >= 2);
@@ -9,4 +9,12 @@ export declare const PLATFORM_NAME_WATCHOS = "watchOS";
9
9
  export declare const PLATFORM_NAME_IOS = "iOS";
10
10
  export declare const SDK_DEVICE = "iphoneos";
11
11
  export declare const WDA_UPGRADE_TIMESTAMP_PATH: string;
12
+ /**
13
+ * Harmless unused build setting override appended to every xcodebuild invocation
14
+ * this package starts. It has no effect on the build itself, but shows up verbatim
15
+ * in the process' command line, letting us tell our own xcodebuild processes apart
16
+ * from unrelated ones (e.g. other WDA-based test runners) that happen to target the
17
+ * same device udid.
18
+ */
19
+ export declare const XCODEBUILD_PROCESS_MARKER = "APPIUM_XCODEBUILD_WDA_MARKER=1";
12
20
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../lib/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,0BAA0B,eAAe,CAAC;AACvD,eAAO,MAAM,oBAAoB,sCAAsC,CAAC;AACxE,eAAO,MAAM,+BAA+B,gDAAyD,CAAC;AACtG,eAAO,MAAM,cAAc,oCAAoC,CAAC;AAChE,eAAO,MAAM,YAAY,oBAAoB,CAAC;AAC9C,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAE/C,eAAO,MAAM,kBAAkB,SAAS,CAAC;AACzC,eAAO,MAAM,qBAAqB,YAAY,CAAC;AAC/C,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AAEvC,eAAO,MAAM,UAAU,aAAa,CAAC;AAErC,eAAO,MAAM,0BAA0B,QAAyD,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../lib/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,0BAA0B,eAAe,CAAC;AACvD,eAAO,MAAM,oBAAoB,sCAAsC,CAAC;AACxE,eAAO,MAAM,+BAA+B,gDAAyD,CAAC;AACtG,eAAO,MAAM,cAAc,oCAAoC,CAAC;AAChE,eAAO,MAAM,YAAY,oBAAoB,CAAC;AAC9C,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAE/C,eAAO,MAAM,kBAAkB,SAAS,CAAC;AACzC,eAAO,MAAM,qBAAqB,YAAY,CAAC;AAC/C,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AAEvC,eAAO,MAAM,UAAU,aAAa,CAAC;AAErC,eAAO,MAAM,0BAA0B,QAAyD,CAAC;AAEjG;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,mCAAmC,CAAC"}
@@ -10,4 +10,12 @@ export const PLATFORM_NAME_WATCHOS = 'watchOS';
10
10
  export const PLATFORM_NAME_IOS = 'iOS';
11
11
  export const SDK_DEVICE = 'iphoneos';
12
12
  export const WDA_UPGRADE_TIMESTAMP_PATH = path.join('.appium', 'webdriveragent', 'upgrade.time');
13
+ /**
14
+ * Harmless unused build setting override appended to every xcodebuild invocation
15
+ * this package starts. It has no effect on the build itself, but shows up verbatim
16
+ * in the process' command line, letting us tell our own xcodebuild processes apart
17
+ * from unrelated ones (e.g. other WDA-based test runners) that happen to target the
18
+ * same device udid.
19
+ */
20
+ export const XCODEBUILD_PROCESS_MARKER = 'APPIUM_XCODEBUILD_WDA_MARKER=1';
13
21
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../lib/constants.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,CAAC,MAAM,0BAA0B,GAAG,YAAY,CAAC;AACvD,MAAM,CAAC,MAAM,oBAAoB,GAAG,mCAAmC,CAAC;AACxE,MAAM,CAAC,MAAM,+BAA+B,GAAG,GAAG,oBAAoB,GAAG,0BAA0B,EAAE,CAAC;AACtG,MAAM,CAAC,MAAM,cAAc,GAAG,iCAAiC,CAAC;AAChE,MAAM,CAAC,MAAM,YAAY,GAAG,iBAAiB,CAAC;AAC9C,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAE/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AACzC,MAAM,CAAC,MAAM,qBAAqB,GAAG,SAAS,CAAC;AAC/C,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEvC,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAC;AAErC,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../lib/constants.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,CAAC,MAAM,0BAA0B,GAAG,YAAY,CAAC;AACvD,MAAM,CAAC,MAAM,oBAAoB,GAAG,mCAAmC,CAAC;AACxE,MAAM,CAAC,MAAM,+BAA+B,GAAG,GAAG,oBAAoB,GAAG,0BAA0B,EAAE,CAAC;AACtG,MAAM,CAAC,MAAM,cAAc,GAAG,iCAAiC,CAAC;AAChE,MAAM,CAAC,MAAM,YAAY,GAAG,iBAAiB,CAAC;AAC9C,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAE/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AACzC,MAAM,CAAC,MAAM,qBAAqB,GAAG,SAAS,CAAC;AAC/C,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEvC,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAC;AAErC,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC;AAEjG;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,gCAAgC,CAAC"}
@@ -1,9 +1,20 @@
1
1
  /**
2
2
  * Find and terminate all processes matching the given pgrep pattern.
3
+ *
4
+ * @param pgrepPattern - Pattern used to find candidate processes.
5
+ * @param cmdlineIncludes - If given, a candidate is only killed if its full
6
+ * command line also contains this substring. Used to narrow a broad pgrep
7
+ * match (e.g. by device udid) down to processes this package actually started.
3
8
  */
4
- export declare function killAppUsingPattern(pgrepPattern: string): Promise<void>;
9
+ export declare function killAppUsingPattern(pgrepPattern: string, cmdlineIncludes?: string): Promise<void>;
5
10
  /**
6
11
  * Kills running XCTest processes for the particular device.
12
+ *
13
+ * The `xcodebuild` pattern is additionally scoped to processes this package started
14
+ * (see {@link XCODEBUILD_PROCESS_MARKER}), so other XCTest-based tools targeting the
15
+ * same udid (e.g. a separately managed WebDriverAgent instance) are left alone.
16
+ * The XCTRunner/xctest patterns below cannot be scoped the same way, since those
17
+ * processes do not inherit xcodebuild's command line.
7
18
  */
8
19
  export declare function resetTestProcesses(udid: string, isSimulator: boolean): Promise<void>;
9
20
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"processes.d.ts","sourceRoot":"","sources":["../../../lib/utils/processes.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA0C7E;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAS1F;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,GAAG,MAAM,EACrB,aAAa,GAAE,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,IAAW,GAC7E,OAAO,CAAC,MAAM,EAAE,CAAC,CAiCnB"}
1
+ {"version":3,"file":"processes.d.ts","sourceRoot":"","sources":["../../../lib/utils/processes.ts"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CAAC,YAAY,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA0CvG;AAED;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAa1F;AA4BD;;;;;;;;;;;;GAYG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,GAAG,MAAM,EACrB,aAAa,GAAE,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,IAAW,GAC7E,OAAO,CAAC,MAAM,EAAE,CAAC,CAkBnB"}
@@ -1,13 +1,19 @@
1
1
  import { waitForCondition } from 'asyncbox';
2
2
  import { exec } from 'teen_process';
3
+ import { XCODEBUILD_PROCESS_MARKER } from '../constants.js';
3
4
  import { log } from '../logger.js';
4
5
  /**
5
6
  * Find and terminate all processes matching the given pgrep pattern.
7
+ *
8
+ * @param pgrepPattern - Pattern used to find candidate processes.
9
+ * @param cmdlineIncludes - If given, a candidate is only killed if its full
10
+ * command line also contains this substring. Used to narrow a broad pgrep
11
+ * match (e.g. by device udid) down to processes this package actually started.
6
12
  */
7
- export async function killAppUsingPattern(pgrepPattern) {
13
+ export async function killAppUsingPattern(pgrepPattern, cmdlineIncludes) {
8
14
  const signals = [2, 15, 9];
9
15
  for (const signal of signals) {
10
- const matchedPids = await getPIDsUsingPattern(pgrepPattern);
16
+ const matchedPids = await getPIDsUsingPattern(pgrepPattern, cmdlineIncludes);
11
17
  if (matchedPids.length === 0) {
12
18
  return;
13
19
  }
@@ -49,6 +55,12 @@ export async function killAppUsingPattern(pgrepPattern) {
49
55
  }
50
56
  /**
51
57
  * Kills running XCTest processes for the particular device.
58
+ *
59
+ * The `xcodebuild` pattern is additionally scoped to processes this package started
60
+ * (see {@link XCODEBUILD_PROCESS_MARKER}), so other XCTest-based tools targeting the
61
+ * same udid (e.g. a separately managed WebDriverAgent instance) are left alone.
62
+ * The XCTRunner/xctest patterns below cannot be scoped the same way, since those
63
+ * processes do not inherit xcodebuild's command line.
52
64
  */
53
65
  export async function resetTestProcesses(udid, isSimulator) {
54
66
  const processPatterns = [`xcodebuild.*${udid}`];
@@ -58,7 +70,28 @@ export async function resetTestProcesses(udid, isSimulator) {
58
70
  processPatterns.push(`xctest.*${udid}`);
59
71
  }
60
72
  log.debug(`Killing running processes '${processPatterns.join(', ')}' for the device ${udid}...`);
61
- await Promise.all(processPatterns.map(killAppUsingPattern));
73
+ await Promise.all(processPatterns.map((pattern) => killAppUsingPattern(pattern, pattern.startsWith('xcodebuild') ? XCODEBUILD_PROCESS_MARKER : undefined)));
74
+ }
75
+ /**
76
+ * Filters a list of PIDs down to those whose full command line satisfies the
77
+ * given lambda. PIDs that have already exited are silently dropped.
78
+ */
79
+ async function filterPIDsByCommandLine(pids, filteringFunc) {
80
+ const filtered = await Promise.all(pids.map(async (pid) => {
81
+ let stdout;
82
+ try {
83
+ ({ stdout } = await exec('ps', ['-p', pid, '-o', 'command']));
84
+ }
85
+ catch (e) {
86
+ if (e.code === 1) {
87
+ // The process does not exist anymore, there's nothing to filter
88
+ return null;
89
+ }
90
+ throw e;
91
+ }
92
+ return (await filteringFunc(stdout)) ? pid : null;
93
+ }));
94
+ return filtered.filter((pid) => Boolean(pid));
62
95
  }
63
96
  /**
64
97
  * Get the IDs of processes listening on the particular system port.
@@ -90,30 +123,17 @@ export async function getPIDsListeningOnPort(port, filteringFunc = null) {
90
123
  if (typeof filteringFunc !== 'function') {
91
124
  return result;
92
125
  }
93
- const filtered = await Promise.all(result.map(async (pid) => {
94
- let stdout;
95
- try {
96
- ({ stdout } = await exec('ps', ['-p', pid, '-o', 'command']));
97
- }
98
- catch (e) {
99
- if (e.code === 1) {
100
- // The process does not exist anymore, there's nothing to filter
101
- return null;
102
- }
103
- throw e;
104
- }
105
- return (await filteringFunc(stdout)) ? pid : null;
106
- }));
107
- return filtered.filter((pid) => Boolean(pid));
126
+ return await filterPIDsByCommandLine(result, filteringFunc);
108
127
  }
109
- async function getPIDsUsingPattern(pattern) {
128
+ async function getPIDsUsingPattern(pattern, cmdlineIncludes) {
110
129
  const args = [
111
130
  '-if', // case insensitive, full cmdline match
112
131
  pattern,
113
132
  ];
133
+ let pids;
114
134
  try {
115
135
  const { stdout } = await exec('pgrep', args);
116
- return stdout
136
+ pids = stdout
117
137
  .split(/\s+/)
118
138
  .map((x) => parseInt(x, 10))
119
139
  .filter(Number.isInteger)
@@ -123,5 +143,9 @@ async function getPIDsUsingPattern(pattern) {
123
143
  log.debug(`'pgrep ${args.join(' ')}' didn't detect any matching processes. Return code: ${err.code}`);
124
144
  return [];
125
145
  }
146
+ if (!cmdlineIncludes || pids.length === 0) {
147
+ return pids;
148
+ }
149
+ return await filterPIDsByCommandLine(pids, (cmdline) => cmdline.includes(cmdlineIncludes));
126
150
  }
127
151
  //# sourceMappingURL=processes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"processes.js","sourceRoot":"","sources":["../../../lib/utils/processes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAC,IAAI,EAAC,MAAM,cAAc,CAAC;AAElC,OAAO,EAAC,GAAG,EAAC,MAAM,cAAc,CAAC;AAEjC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,YAAoB;IAC5D,MAAM,OAAO,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAC3B,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,WAAW,GAAG,MAAM,mBAAmB,CAAC,YAAY,CAAC,CAAC;QAC5D,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC7B,OAAO;QACT,CAAC;QACD,MAAM,IAAI,GAAG,CAAC,IAAI,MAAM,EAAE,EAAE,GAAG,WAAW,CAAC,CAAC;QAC5C,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC3B,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,GAAG,CAAC,KAAK,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QACxD,CAAC;QACD,IAAI,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC;YAC3C,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A6Bb,kBAAkB;IAmChC,OAAO,CAAC,UAAU;YAgFJ,gBAAgB;YAmEhB,YAAY;CAgD3B"}
@@ -2,7 +2,7 @@ import path from 'node:path';
2
2
  import { logger, timing, util } from '@appium/support';
3
3
  import { retryInterval } from 'asyncbox';
4
4
  import { SubProcess, exec } from 'teen_process';
5
- import { WDA_RUNNER_BUNDLE_ID } from './constants.js';
5
+ import { WDA_RUNNER_BUNDLE_ID, XCODEBUILD_PROCESS_MARKER } from './constants.js';
6
6
  import { log as defaultLogger } from './logger.js';
7
7
  import { getPlatformSchemeSuffix, getWDAUpgradeTimestamp, isTvOS, isWatchOS, setRealDeviceSecurity, setXctestrunFile, } from './utils/index.js';
8
8
  const DEFAULT_SIGNING_ID = 'iPhone Developer';
@@ -361,6 +361,9 @@ export class XcodeBuild {
361
361
  // Below option slightly reduces build time in debug build
362
362
  // with preventing to generate `/Index/DataStore` which is used by development
363
363
  args.push('COMPILER_INDEX_STORE_ENABLE=NO');
364
+ // Tags this process so resetTestProcesses() can kill only xcodebuild instances
365
+ // this package started, not unrelated ones sharing the same device udid.
366
+ args.push(XCODEBUILD_PROCESS_MARKER);
364
367
  return { cmd, args };
365
368
  }
366
369
  async createSubProcess(buildOnly = false) {
@@ -1 +1 @@
1
- {"version":3,"file":"xcodebuild.js","sourceRoot":"","sources":["../../lib/xcodebuild.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAC,MAAM,iBAAiB,CAAC;AAErD,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AACvC,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAC,oBAAoB,EAAC,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAC,GAAG,IAAI,aAAa,EAAC,MAAM,aAAa,CAAC;AASjD,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACt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,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;IACD,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IACD,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;QAC1B,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACrD,CAAC;IACD,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;QACxB,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,qBAAqB,CAAC,OAAsC;IACnE,OAAO,4BAA4B,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1D,CAAC"}
package/lib/constants.ts CHANGED
@@ -14,3 +14,12 @@ export const PLATFORM_NAME_IOS = 'iOS';
14
14
  export const SDK_DEVICE = 'iphoneos';
15
15
 
16
16
  export const WDA_UPGRADE_TIMESTAMP_PATH = path.join('.appium', 'webdriveragent', 'upgrade.time');
17
+
18
+ /**
19
+ * Harmless unused build setting override appended to every xcodebuild invocation
20
+ * this package starts. It has no effect on the build itself, but shows up verbatim
21
+ * in the process' command line, letting us tell our own xcodebuild processes apart
22
+ * from unrelated ones (e.g. other WDA-based test runners) that happen to target the
23
+ * same device udid.
24
+ */
25
+ export const XCODEBUILD_PROCESS_MARKER = 'APPIUM_XCODEBUILD_WDA_MARKER=1';
@@ -1,15 +1,21 @@
1
1
  import {waitForCondition} from 'asyncbox';
2
2
  import {exec} from 'teen_process';
3
3
 
4
+ import {XCODEBUILD_PROCESS_MARKER} from '../constants.js';
4
5
  import {log} from '../logger.js';
5
6
 
6
7
  /**
7
8
  * Find and terminate all processes matching the given pgrep pattern.
9
+ *
10
+ * @param pgrepPattern - Pattern used to find candidate processes.
11
+ * @param cmdlineIncludes - If given, a candidate is only killed if its full
12
+ * command line also contains this substring. Used to narrow a broad pgrep
13
+ * match (e.g. by device udid) down to processes this package actually started.
8
14
  */
9
- export async function killAppUsingPattern(pgrepPattern: string): Promise<void> {
15
+ export async function killAppUsingPattern(pgrepPattern: string, cmdlineIncludes?: string): Promise<void> {
10
16
  const signals = [2, 15, 9];
11
17
  for (const signal of signals) {
12
- const matchedPids = await getPIDsUsingPattern(pgrepPattern);
18
+ const matchedPids = await getPIDsUsingPattern(pgrepPattern, cmdlineIncludes);
13
19
  if (matchedPids.length === 0) {
14
20
  return;
15
21
  }
@@ -52,6 +58,12 @@ export async function killAppUsingPattern(pgrepPattern: string): Promise<void> {
52
58
 
53
59
  /**
54
60
  * Kills running XCTest processes for the particular device.
61
+ *
62
+ * The `xcodebuild` pattern is additionally scoped to processes this package started
63
+ * (see {@link XCODEBUILD_PROCESS_MARKER}), so other XCTest-based tools targeting the
64
+ * same udid (e.g. a separately managed WebDriverAgent instance) are left alone.
65
+ * The XCTRunner/xctest patterns below cannot be scoped the same way, since those
66
+ * processes do not inherit xcodebuild's command line.
55
67
  */
56
68
  export async function resetTestProcesses(udid: string, isSimulator: boolean): Promise<void> {
57
69
  const processPatterns = [`xcodebuild.*${udid}`];
@@ -61,7 +73,37 @@ export async function resetTestProcesses(udid: string, isSimulator: boolean): Pr
61
73
  processPatterns.push(`xctest.*${udid}`);
62
74
  }
63
75
  log.debug(`Killing running processes '${processPatterns.join(', ')}' for the device ${udid}...`);
64
- await Promise.all(processPatterns.map(killAppUsingPattern));
76
+ await Promise.all(
77
+ processPatterns.map((pattern) =>
78
+ killAppUsingPattern(pattern, pattern.startsWith('xcodebuild') ? XCODEBUILD_PROCESS_MARKER : undefined),
79
+ ),
80
+ );
81
+ }
82
+
83
+ /**
84
+ * Filters a list of PIDs down to those whose full command line satisfies the
85
+ * given lambda. PIDs that have already exited are silently dropped.
86
+ */
87
+ async function filterPIDsByCommandLine(
88
+ pids: string[],
89
+ filteringFunc: (cmdline: string) => boolean | Promise<boolean>,
90
+ ): Promise<string[]> {
91
+ const filtered = await Promise.all(
92
+ pids.map(async (pid) => {
93
+ let stdout: string;
94
+ try {
95
+ ({stdout} = await exec('ps', ['-p', pid, '-o', 'command']));
96
+ } catch (e: any) {
97
+ if (e.code === 1) {
98
+ // The process does not exist anymore, there's nothing to filter
99
+ return null;
100
+ }
101
+ throw e;
102
+ }
103
+ return (await filteringFunc(stdout)) ? pid : null;
104
+ }),
105
+ );
106
+ return filtered.filter((pid): pid is string => Boolean(pid));
65
107
  }
66
108
 
67
109
  /**
@@ -97,32 +139,18 @@ export async function getPIDsListeningOnPort(
97
139
  if (typeof filteringFunc !== 'function') {
98
140
  return result;
99
141
  }
100
- const filtered = await Promise.all(
101
- result.map(async (pid) => {
102
- let stdout: string;
103
- try {
104
- ({stdout} = await exec('ps', ['-p', pid, '-o', 'command']));
105
- } catch (e: any) {
106
- if (e.code === 1) {
107
- // The process does not exist anymore, there's nothing to filter
108
- return null;
109
- }
110
- throw e;
111
- }
112
- return (await filteringFunc(stdout)) ? pid : null;
113
- }),
114
- );
115
- return filtered.filter((pid): pid is string => Boolean(pid));
142
+ return await filterPIDsByCommandLine(result, filteringFunc);
116
143
  }
117
144
 
118
- async function getPIDsUsingPattern(pattern: string): Promise<string[]> {
145
+ async function getPIDsUsingPattern(pattern: string, cmdlineIncludes?: string): Promise<string[]> {
119
146
  const args = [
120
147
  '-if', // case insensitive, full cmdline match
121
148
  pattern,
122
149
  ];
150
+ let pids: string[];
123
151
  try {
124
152
  const {stdout} = await exec('pgrep', args);
125
- return stdout
153
+ pids = stdout
126
154
  .split(/\s+/)
127
155
  .map((x) => parseInt(x, 10))
128
156
  .filter(Number.isInteger)
@@ -131,4 +159,8 @@ async function getPIDsUsingPattern(pattern: string): Promise<string[]> {
131
159
  log.debug(`'pgrep ${args.join(' ')}' didn't detect any matching processes. Return code: ${err.code}`);
132
160
  return [];
133
161
  }
162
+ if (!cmdlineIncludes || pids.length === 0) {
163
+ return pids;
164
+ }
165
+ return await filterPIDsByCommandLine(pids, (cmdline) => cmdline.includes(cmdlineIncludes));
134
166
  }
package/lib/xcodebuild.ts CHANGED
@@ -5,7 +5,7 @@ import type {AppiumLogger, StringRecord} from '@appium/types';
5
5
  import {retryInterval} from 'asyncbox';
6
6
  import {SubProcess, exec} from 'teen_process';
7
7
 
8
- import {WDA_RUNNER_BUNDLE_ID} from './constants.js';
8
+ import {WDA_RUNNER_BUNDLE_ID, XCODEBUILD_PROCESS_MARKER} from './constants.js';
9
9
  import {log as defaultLogger} from './logger.js';
10
10
  import type {NoSessionProxy} from './no-session-proxy.js';
11
11
  import type {
@@ -431,6 +431,10 @@ export class XcodeBuild {
431
431
  // with preventing to generate `/Index/DataStore` which is used by development
432
432
  args.push('COMPILER_INDEX_STORE_ENABLE=NO');
433
433
 
434
+ // Tags this process so resetTestProcesses() can kill only xcodebuild instances
435
+ // this package started, not unrelated ones sharing the same device udid.
436
+ args.push(XCODEBUILD_PROCESS_MARKER);
437
+
434
438
  return {cmd, args};
435
439
  }
436
440
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium-webdriveragent",
3
- "version": "16.11.3",
3
+ "version": "16.12.0",
4
4
  "description": "Package bundling WebDriverAgent",
5
5
  "keywords": [
6
6
  "Appium",