appium-adb 14.3.2 → 14.3.4

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/lib/adb.d.ts +9 -9
  3. package/build/lib/adb.d.ts.map +1 -1
  4. package/build/lib/adb.js +61 -61
  5. package/build/lib/adb.js.map +1 -1
  6. package/build/lib/logcat.d.ts.map +1 -1
  7. package/build/lib/logcat.js +43 -37
  8. package/build/lib/logcat.js.map +1 -1
  9. package/build/lib/tools/aab-utils.d.ts.map +1 -1
  10. package/build/lib/tools/aab-utils.js +1 -2
  11. package/build/lib/tools/aab-utils.js.map +1 -1
  12. package/build/lib/tools/apk-utils.d.ts.map +1 -1
  13. package/build/lib/tools/apk-utils.js +29 -29
  14. package/build/lib/tools/apk-utils.js.map +1 -1
  15. package/build/lib/tools/apks-utils.d.ts.map +1 -1
  16. package/build/lib/tools/apks-utils.js +44 -45
  17. package/build/lib/tools/apks-utils.js.map +1 -1
  18. package/build/lib/tools/app-commands.d.ts +11 -11
  19. package/build/lib/tools/app-commands.d.ts.map +1 -1
  20. package/build/lib/tools/app-commands.js +0 -2
  21. package/build/lib/tools/app-commands.js.map +1 -1
  22. package/build/lib/tools/device-settings.d.ts.map +1 -1
  23. package/build/lib/tools/device-settings.js +14 -15
  24. package/build/lib/tools/device-settings.js.map +1 -1
  25. package/build/lib/tools/emulator-commands.d.ts.map +1 -1
  26. package/build/lib/tools/emulator-commands.js +43 -44
  27. package/build/lib/tools/emulator-commands.js.map +1 -1
  28. package/build/lib/tools/fs-commands.d.ts.map +1 -1
  29. package/build/lib/tools/fs-commands.js +3 -3
  30. package/build/lib/tools/fs-commands.js.map +1 -1
  31. package/build/lib/tools/keyboard-commands.d.ts.map +1 -1
  32. package/build/lib/tools/keyboard-commands.js +1 -5
  33. package/build/lib/tools/keyboard-commands.js.map +1 -1
  34. package/build/lib/tools/lockmgmt.d.ts.map +1 -1
  35. package/build/lib/tools/lockmgmt.js +72 -73
  36. package/build/lib/tools/lockmgmt.js.map +1 -1
  37. package/build/lib/tools/process-commands.d.ts.map +1 -1
  38. package/build/lib/tools/process-commands.js +1 -2
  39. package/build/lib/tools/process-commands.js.map +1 -1
  40. package/build/lib/tools/system-calls.d.ts +6 -6
  41. package/build/lib/tools/system-calls.d.ts.map +1 -1
  42. package/build/lib/tools/system-calls.js +11 -14
  43. package/build/lib/tools/system-calls.js.map +1 -1
  44. package/lib/adb.ts +69 -69
  45. package/lib/logcat.ts +47 -44
  46. package/lib/tools/aab-utils.ts +1 -2
  47. package/lib/tools/apk-utils.ts +37 -37
  48. package/lib/tools/apks-utils.ts +50 -51
  49. package/lib/tools/app-commands.ts +12 -16
  50. package/lib/tools/device-settings.ts +15 -16
  51. package/lib/tools/emulator-commands.ts +51 -52
  52. package/lib/tools/fs-commands.ts +4 -4
  53. package/lib/tools/keyboard-commands.ts +2 -3
  54. package/lib/tools/lockmgmt.ts +85 -86
  55. package/lib/tools/process-commands.ts +1 -2
  56. package/lib/tools/system-calls.ts +12 -17
  57. package/package.json +1 -3
@@ -1,6 +1,5 @@
1
1
  import _ from 'lodash';
2
2
  import {log} from '../logger';
3
- import B from 'bluebird';
4
3
  import type {ExecError} from 'teen_process';
5
4
  import type {ADB} from '../adb';
6
5
 
@@ -130,7 +129,7 @@ export async function killProcessesByName(
130
129
  if (_.isEmpty(pids)) {
131
130
  log.info(`No '${name}' process has been found`);
132
131
  } else {
133
- await B.all(pids.map((p: number) => this.killProcessByPID(p, signal)));
132
+ await Promise.all(pids.map((p: number) => this.killProcessByPID(p, signal)));
134
133
  }
135
134
  } catch (e: unknown) {
136
135
  const err: Error = e as Error;
@@ -1,11 +1,10 @@
1
1
  import path from 'node:path';
2
2
  import {log} from '../logger';
3
- import B from 'bluebird';
4
3
  import {system, fs, util, tempDir, timing} from '@appium/support';
5
4
  import {DEFAULT_ADB_EXEC_TIMEOUT, getSdkRootFromEnv} from '../helpers';
6
5
  import {exec, SubProcess} from 'teen_process';
7
6
  import type {ExecError, TeenProcessExecResult} from 'teen_process';
8
- import {retry, retryInterval, waitForCondition} from 'asyncbox';
7
+ import {asyncmap, retry, retryInterval, sleep, waitForCondition} from 'asyncbox';
9
8
  import _ from 'lodash';
10
9
  import * as semver from 'semver';
11
10
  import type {ADB} from '../adb';
@@ -43,7 +42,15 @@ const MIN_DELAY_ADB_API_LEVEL = 28;
43
42
  const REQUIRED_SERVICES = ['activity', 'package', 'window'] as const;
44
43
  const MAX_SHELL_BUFFER_LENGTH = 1000;
45
44
 
46
- // Private methods (defined early as they're used by public methods)
45
+ /**
46
+ * Retrieve full path to the given binary.
47
+ *
48
+ * @param binaryName - The name of the binary
49
+ * @returns The full path to the binary
50
+ */
51
+ export async function getSdkBinaryPath(this: ADB, binaryName: string): Promise<string> {
52
+ return await this.getBinaryFromSdkRoot(binaryName);
53
+ }
47
54
 
48
55
  /**
49
56
  * Retrieve full binary name for the current operating system.
@@ -93,18 +100,6 @@ async function getOpenSslForOs(): Promise<string> {
93
100
  }
94
101
  }
95
102
 
96
- // Public methods
97
-
98
- /**
99
- * Retrieve full path to the given binary.
100
- *
101
- * @param binaryName - The name of the binary
102
- * @returns The full path to the binary
103
- */
104
- export async function getSdkBinaryPath(this: ADB, binaryName: string): Promise<string> {
105
- return await this.getBinaryFromSdkRoot(binaryName);
106
- }
107
-
108
103
  export const getBinaryNameForOS = _.memoize(_getBinaryNameForOS);
109
104
 
110
105
  /**
@@ -1124,7 +1119,7 @@ export async function reboot(
1124
1119
  try {
1125
1120
  // Stop and re-start the device
1126
1121
  await this.shell(['stop']);
1127
- await B.delay(2000); // let the emu finish stopping;
1122
+ await sleep(2000); // let the emu finish stopping;
1128
1123
  await this.setDeviceProperty('sys.boot_completed', '0', {
1129
1124
  privileged: false, // no need to set privileged true because device already rooted
1130
1125
  });
@@ -1443,7 +1438,7 @@ export const getBuildToolsDirs = _.memoize(async function getBuildToolsDirs(
1443
1438
  `by semantic version names.`,
1444
1439
  );
1445
1440
  log.warn(`Falling back to sorting by modification date. Original error: ${error.message}`);
1446
- const pairs = await B.map(
1441
+ const pairs = await asyncmap(
1447
1442
  buildToolsDirs,
1448
1443
  async (dir) => [(await fs.stat(dir)).mtime.valueOf(), dir] as [number, string],
1449
1444
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium-adb",
3
- "version": "14.3.2",
3
+ "version": "14.3.4",
4
4
  "description": "Android Debug Bridge interface",
5
5
  "main": "./build/lib/index.js",
6
6
  "scripts": {
@@ -49,7 +49,6 @@
49
49
  "@appium/support": "^7.0.0-rc.1",
50
50
  "async-lock": "^1.0.0",
51
51
  "asyncbox": "^6.0.1",
52
- "bluebird": "^3.4.7",
53
52
  "ini": "^6.0.0",
54
53
  "lodash": "^4.0.0",
55
54
  "lru-cache": "^11.1.0",
@@ -63,7 +62,6 @@
63
62
  "@semantic-release/changelog": "^6.0.1",
64
63
  "@semantic-release/git": "^10.0.1",
65
64
  "@types/async-lock": "^1.4.0",
66
- "@types/bluebird": "^3.5.38",
67
65
  "@types/ini": "^4.1.0",
68
66
  "@types/lodash": "^4.14.195",
69
67
  "@types/mocha": "^10.0.1",