appium-android-driver 7.8.2 → 8.0.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.
Files changed (261) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/build/lib/commands/app-management.d.ts +129 -5
  3. package/build/lib/commands/app-management.d.ts.map +1 -1
  4. package/build/lib/commands/app-management.js +433 -128
  5. package/build/lib/commands/app-management.js.map +1 -1
  6. package/build/lib/commands/appearance.d.ts +17 -4
  7. package/build/lib/commands/appearance.d.ts.map +1 -1
  8. package/build/lib/commands/appearance.js +32 -33
  9. package/build/lib/commands/appearance.js.map +1 -1
  10. package/build/lib/commands/context/cache.d.ts +19 -0
  11. package/build/lib/commands/context/cache.d.ts.map +1 -0
  12. package/build/lib/commands/context/cache.js +32 -0
  13. package/build/lib/commands/context/cache.js.map +1 -0
  14. package/build/lib/commands/context/exports.d.ts +141 -0
  15. package/build/lib/commands/context/exports.d.ts.map +1 -0
  16. package/build/lib/commands/context/exports.js +351 -0
  17. package/build/lib/commands/context/exports.js.map +1 -0
  18. package/build/lib/commands/context/helpers.d.ts +98 -0
  19. package/build/lib/commands/context/helpers.d.ts.map +1 -0
  20. package/build/lib/commands/context/helpers.js +715 -0
  21. package/build/lib/commands/context/helpers.js.map +1 -0
  22. package/build/lib/commands/device/common.d.ts +23 -0
  23. package/build/lib/commands/device/common.d.ts.map +1 -0
  24. package/build/lib/commands/device/common.js +230 -0
  25. package/build/lib/commands/device/common.js.map +1 -0
  26. package/build/lib/commands/device/emulator-actions.d.ts +114 -0
  27. package/build/lib/commands/device/emulator-actions.d.ts.map +1 -0
  28. package/build/lib/commands/device/emulator-actions.js +197 -0
  29. package/build/lib/commands/device/emulator-actions.js.map +1 -0
  30. package/build/lib/commands/device/emulator-console.d.ts +7 -0
  31. package/build/lib/commands/device/emulator-console.d.ts.map +1 -0
  32. package/build/lib/commands/device/emulator-console.js +24 -0
  33. package/build/lib/commands/device/emulator-console.js.map +1 -0
  34. package/build/lib/commands/device/utils.d.ts +50 -0
  35. package/build/lib/commands/device/utils.d.ts.map +1 -0
  36. package/build/lib/commands/device/utils.js +238 -0
  37. package/build/lib/commands/device/utils.js.map +1 -0
  38. package/build/lib/commands/deviceidle.d.ts +8 -5
  39. package/build/lib/commands/deviceidle.d.ts.map +1 -1
  40. package/build/lib/commands/deviceidle.js +31 -37
  41. package/build/lib/commands/deviceidle.js.map +1 -1
  42. package/build/lib/commands/element.d.ts +99 -5
  43. package/build/lib/commands/element.d.ts.map +1 -1
  44. package/build/lib/commands/element.js +152 -116
  45. package/build/lib/commands/element.js.map +1 -1
  46. package/build/lib/commands/execute.d.ts +12 -4
  47. package/build/lib/commands/execute.d.ts.map +1 -1
  48. package/build/lib/commands/execute.js +83 -78
  49. package/build/lib/commands/execute.js.map +1 -1
  50. package/build/lib/commands/file-actions.d.ts +42 -5
  51. package/build/lib/commands/file-actions.d.ts.map +1 -1
  52. package/build/lib/commands/file-actions.js +230 -194
  53. package/build/lib/commands/file-actions.js.map +1 -1
  54. package/build/lib/commands/find.d.ts +5 -4
  55. package/build/lib/commands/find.d.ts.map +1 -1
  56. package/build/lib/commands/find.js +7 -10
  57. package/build/lib/commands/find.js.map +1 -1
  58. package/build/lib/commands/geolocation.d.ts +45 -0
  59. package/build/lib/commands/geolocation.d.ts.map +1 -0
  60. package/build/lib/commands/geolocation.js +182 -0
  61. package/build/lib/commands/geolocation.js.map +1 -0
  62. package/build/lib/commands/ime.d.ts +25 -5
  63. package/build/lib/commands/ime.d.ts.map +1 -1
  64. package/build/lib/commands/ime.js +59 -42
  65. package/build/lib/commands/ime.js.map +1 -1
  66. package/build/lib/commands/intent.d.ts +56 -5
  67. package/build/lib/commands/intent.d.ts.map +1 -1
  68. package/build/lib/commands/intent.js +135 -83
  69. package/build/lib/commands/intent.js.map +1 -1
  70. package/build/lib/commands/keyboard.d.ts +58 -4
  71. package/build/lib/commands/keyboard.d.ts.map +1 -1
  72. package/build/lib/commands/keyboard.js +119 -17
  73. package/build/lib/commands/keyboard.js.map +1 -1
  74. package/build/lib/commands/lock/exports.d.ts +301 -0
  75. package/build/lib/commands/lock/exports.d.ts.map +1 -0
  76. package/build/lib/commands/lock/exports.js +121 -0
  77. package/build/lib/commands/lock/exports.js.map +1 -0
  78. package/build/lib/commands/lock/helpers.d.ts +349 -0
  79. package/build/lib/commands/lock/helpers.d.ts.map +1 -0
  80. package/build/lib/commands/lock/helpers.js +375 -0
  81. package/build/lib/commands/lock/helpers.js.map +1 -0
  82. package/build/lib/commands/log.d.ts +59 -5
  83. package/build/lib/commands/log.d.ts.map +1 -1
  84. package/build/lib/commands/log.js +150 -140
  85. package/build/lib/commands/log.js.map +1 -1
  86. package/build/lib/commands/media-projection.d.ts +16 -5
  87. package/build/lib/commands/media-projection.d.ts.map +1 -1
  88. package/build/lib/commands/media-projection.js +69 -58
  89. package/build/lib/commands/media-projection.js.map +1 -1
  90. package/build/lib/commands/memory.d.ts +9 -5
  91. package/build/lib/commands/memory.d.ts.map +1 -1
  92. package/build/lib/commands/memory.js +19 -24
  93. package/build/lib/commands/memory.js.map +1 -1
  94. package/build/lib/commands/misc.d.ts +42 -0
  95. package/build/lib/commands/misc.d.ts.map +1 -0
  96. package/build/lib/commands/misc.js +100 -0
  97. package/build/lib/commands/misc.js.map +1 -0
  98. package/build/lib/commands/network.d.ts +61 -5
  99. package/build/lib/commands/network.d.ts.map +1 -1
  100. package/build/lib/commands/network.js +196 -189
  101. package/build/lib/commands/network.js.map +1 -1
  102. package/build/lib/commands/performance.d.ts +67 -27
  103. package/build/lib/commands/performance.d.ts.map +1 -1
  104. package/build/lib/commands/performance.js +105 -80
  105. package/build/lib/commands/performance.js.map +1 -1
  106. package/build/lib/commands/permissions.d.ts +12 -6
  107. package/build/lib/commands/permissions.d.ts.map +1 -1
  108. package/build/lib/commands/permissions.js +65 -62
  109. package/build/lib/commands/permissions.js.map +1 -1
  110. package/build/lib/commands/recordscreen.d.ts +44 -5
  111. package/build/lib/commands/recordscreen.d.ts.map +1 -1
  112. package/build/lib/commands/recordscreen.js +131 -126
  113. package/build/lib/commands/recordscreen.js.map +1 -1
  114. package/build/lib/commands/resources.d.ts +16 -0
  115. package/build/lib/commands/resources.d.ts.map +1 -0
  116. package/build/lib/commands/resources.js +91 -0
  117. package/build/lib/commands/resources.js.map +1 -0
  118. package/build/lib/commands/shell.d.ts +8 -5
  119. package/build/lib/commands/shell.d.ts.map +1 -1
  120. package/build/lib/commands/shell.js +29 -33
  121. package/build/lib/commands/shell.js.map +1 -1
  122. package/build/lib/commands/streamscreen.d.ts +34 -6
  123. package/build/lib/commands/streamscreen.d.ts.map +1 -1
  124. package/build/lib/commands/streamscreen.js +166 -162
  125. package/build/lib/commands/streamscreen.js.map +1 -1
  126. package/build/lib/commands/system-bars.d.ts +18 -13
  127. package/build/lib/commands/system-bars.d.ts.map +1 -1
  128. package/build/lib/commands/system-bars.js +68 -64
  129. package/build/lib/commands/system-bars.js.map +1 -1
  130. package/build/lib/commands/time.d.ts +14 -0
  131. package/build/lib/commands/time.d.ts.map +1 -0
  132. package/build/lib/commands/time.js +39 -0
  133. package/build/lib/commands/time.js.map +1 -0
  134. package/build/lib/commands/touch.d.ts +99 -6
  135. package/build/lib/commands/touch.d.ts.map +1 -1
  136. package/build/lib/commands/touch.js +399 -280
  137. package/build/lib/commands/touch.js.map +1 -1
  138. package/build/lib/commands/types.d.ts +115 -3
  139. package/build/lib/commands/types.d.ts.map +1 -1
  140. package/build/lib/doctor/checks.d.ts.map +1 -1
  141. package/build/lib/doctor/checks.js +4 -4
  142. package/build/lib/doctor/checks.js.map +1 -1
  143. package/build/lib/driver.d.ts +224 -27
  144. package/build/lib/driver.d.ts.map +1 -1
  145. package/build/lib/driver.js +232 -7
  146. package/build/lib/driver.js.map +1 -1
  147. package/build/lib/index.d.ts +1 -4
  148. package/build/lib/index.d.ts.map +1 -1
  149. package/build/lib/index.js +1 -13
  150. package/build/lib/index.js.map +1 -1
  151. package/build/lib/logger.js.map +1 -1
  152. package/build/lib/method-map.d.ts +0 -23
  153. package/build/lib/method-map.d.ts.map +1 -1
  154. package/build/lib/method-map.js +0 -11
  155. package/build/lib/method-map.js.map +1 -1
  156. package/build/lib/utils.d.ts +12 -0
  157. package/build/lib/utils.d.ts.map +1 -1
  158. package/build/lib/utils.js +38 -2
  159. package/build/lib/utils.js.map +1 -1
  160. package/lib/commands/app-management.js +470 -145
  161. package/lib/commands/appearance.js +29 -36
  162. package/lib/commands/context/cache.js +29 -0
  163. package/lib/commands/context/exports.js +379 -0
  164. package/lib/commands/context/helpers.js +802 -0
  165. package/lib/commands/device/common.js +264 -0
  166. package/lib/commands/device/emulator-actions.js +194 -0
  167. package/lib/commands/device/emulator-console.js +24 -0
  168. package/lib/commands/device/utils.js +285 -0
  169. package/lib/commands/deviceidle.js +31 -44
  170. package/lib/commands/element.js +149 -142
  171. package/lib/commands/execute.js +86 -87
  172. package/lib/commands/file-actions.js +249 -222
  173. package/lib/commands/find.ts +13 -19
  174. package/lib/commands/geolocation.js +179 -0
  175. package/lib/commands/ime.js +53 -45
  176. package/lib/commands/intent.js +149 -91
  177. package/lib/commands/keyboard.js +114 -17
  178. package/lib/commands/lock/exports.js +139 -0
  179. package/lib/commands/lock/helpers.js +379 -0
  180. package/lib/commands/log.js +170 -166
  181. package/lib/commands/media-projection.js +75 -70
  182. package/lib/commands/memory.js +17 -29
  183. package/lib/commands/misc.js +94 -0
  184. package/lib/commands/network.js +209 -223
  185. package/lib/commands/performance.js +88 -73
  186. package/lib/commands/permissions.js +83 -84
  187. package/lib/commands/recordscreen.js +171 -170
  188. package/lib/commands/resources.js +96 -0
  189. package/lib/commands/shell.js +28 -42
  190. package/lib/commands/streamscreen.js +207 -206
  191. package/lib/commands/system-bars.js +76 -77
  192. package/lib/commands/time.js +36 -0
  193. package/lib/commands/touch.js +442 -346
  194. package/lib/commands/types.ts +142 -10
  195. package/lib/doctor/checks.js +24 -16
  196. package/lib/driver.ts +454 -12
  197. package/lib/index.ts +1 -13
  198. package/lib/logger.js +1 -1
  199. package/lib/method-map.js +0 -11
  200. package/lib/utils.js +40 -3
  201. package/package.json +1 -1
  202. package/build/lib/commands/actions.d.ts +0 -8
  203. package/build/lib/commands/actions.d.ts.map +0 -1
  204. package/build/lib/commands/actions.js +0 -207
  205. package/build/lib/commands/actions.js.map +0 -1
  206. package/build/lib/commands/alert.d.ts +0 -8
  207. package/build/lib/commands/alert.d.ts.map +0 -1
  208. package/build/lib/commands/alert.js +0 -29
  209. package/build/lib/commands/alert.js.map +0 -1
  210. package/build/lib/commands/context.d.ts +0 -10
  211. package/build/lib/commands/context.d.ts.map +0 -1
  212. package/build/lib/commands/context.js +0 -431
  213. package/build/lib/commands/context.js.map +0 -1
  214. package/build/lib/commands/emu-console.d.ts +0 -7
  215. package/build/lib/commands/emu-console.d.ts.map +0 -1
  216. package/build/lib/commands/emu-console.js +0 -27
  217. package/build/lib/commands/emu-console.js.map +0 -1
  218. package/build/lib/commands/general.d.ts +0 -9
  219. package/build/lib/commands/general.d.ts.map +0 -1
  220. package/build/lib/commands/general.js +0 -293
  221. package/build/lib/commands/general.js.map +0 -1
  222. package/build/lib/commands/index.d.ts +0 -28
  223. package/build/lib/commands/index.d.ts.map +0 -1
  224. package/build/lib/commands/index.js +0 -57
  225. package/build/lib/commands/index.js.map +0 -1
  226. package/build/lib/commands/mixins.d.ts +0 -747
  227. package/build/lib/commands/mixins.d.ts.map +0 -1
  228. package/build/lib/commands/mixins.js +0 -19
  229. package/build/lib/commands/mixins.js.map +0 -1
  230. package/build/lib/helpers/android.d.ts +0 -163
  231. package/build/lib/helpers/android.d.ts.map +0 -1
  232. package/build/lib/helpers/android.js +0 -818
  233. package/build/lib/helpers/android.js.map +0 -1
  234. package/build/lib/helpers/index.d.ts +0 -7
  235. package/build/lib/helpers/index.d.ts.map +0 -1
  236. package/build/lib/helpers/index.js +0 -29
  237. package/build/lib/helpers/index.js.map +0 -1
  238. package/build/lib/helpers/types.d.ts +0 -122
  239. package/build/lib/helpers/types.d.ts.map +0 -1
  240. package/build/lib/helpers/types.js +0 -3
  241. package/build/lib/helpers/types.js.map +0 -1
  242. package/build/lib/helpers/unlock.d.ts +0 -32
  243. package/build/lib/helpers/unlock.d.ts.map +0 -1
  244. package/build/lib/helpers/unlock.js +0 -273
  245. package/build/lib/helpers/unlock.js.map +0 -1
  246. package/build/lib/helpers/webview.d.ts +0 -74
  247. package/build/lib/helpers/webview.d.ts.map +0 -1
  248. package/build/lib/helpers/webview.js +0 -442
  249. package/build/lib/helpers/webview.js.map +0 -1
  250. package/lib/commands/actions.js +0 -244
  251. package/lib/commands/alert.js +0 -34
  252. package/lib/commands/context.js +0 -507
  253. package/lib/commands/emu-console.js +0 -31
  254. package/lib/commands/general.js +0 -343
  255. package/lib/commands/index.ts +0 -54
  256. package/lib/commands/mixins.ts +0 -976
  257. package/lib/helpers/android.ts +0 -1153
  258. package/lib/helpers/index.ts +0 -6
  259. package/lib/helpers/types.ts +0 -136
  260. package/lib/helpers/unlock.ts +0 -329
  261. package/lib/helpers/webview.ts +0 -604
@@ -1,152 +1,457 @@
1
1
  "use strict";
2
- // @ts-check
3
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
4
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
5
4
  };
6
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getThirdPartyPackages = exports.uninstallOtherPackages = exports.installOtherApks = exports.installApk = exports.resetApp = exports.background = exports.getCurrentPackage = exports.getCurrentActivity = exports.mobileClearApp = exports.mobileInstallApp = exports.installApp = exports.mobileTerminateApp = exports.terminateApp = exports.mobileRemoveApp = exports.removeApp = exports.mobileActivateApp = exports.activateApp = exports.mobileQueryAppState = exports.queryAppState = exports.mobileIsAppInstalled = exports.isAppInstalled = exports.APP_STATE = void 0;
7
7
  const support_1 = require("@appium/support");
8
8
  const asyncbox_1 = require("asyncbox");
9
9
  const lodash_1 = __importDefault(require("lodash"));
10
- const helpers_1 = require("../helpers");
11
10
  const utils_1 = require("../utils");
12
- const mixins_1 = require("./mixins");
11
+ const node_os_1 = require("node:os");
12
+ const bluebird_1 = __importDefault(require("bluebird"));
13
13
  const APP_EXTENSIONS = ['.apk', '.apks'];
14
14
  const RESOLVER_ACTIVITY_NAME = 'android/com.android.internal.app.ResolverActivity';
15
+ const PACKAGE_INSTALL_TIMEOUT_MS = 90000;
16
+ // These constants are in sync with
17
+ // https://developer.apple.com/documentation/xctest/xcuiapplicationstate/xcuiapplicationstaterunningbackground?language=objc
18
+ exports.APP_STATE = ({
19
+ NOT_INSTALLED: 0,
20
+ NOT_RUNNING: 1,
21
+ RUNNING_IN_BACKGROUND: 3,
22
+ RUNNING_IN_FOREGROUND: 4,
23
+ });
15
24
  /**
16
- * @type {import('./mixins').AppManagementMixin & ThisType<import('../driver').AndroidDriver>}
17
- * @satisfies {import('@appium/types').ExternalDriver}
18
- */
19
- const AppManagementMixin = {
20
- async isAppInstalled(appId) {
21
- return await this.adb.isAppInstalled(appId);
22
- },
23
- async mobileIsAppInstalled(opts) {
24
- const { appId } = (0, utils_1.requireArgs)('appId', opts);
25
- return await this.isAppInstalled(appId);
26
- },
27
- async queryAppState(appId) {
28
- this.log.info(`Querying the state of '${appId}'`);
29
- if (!(await this.adb.isAppInstalled(appId))) {
30
- return helpers_1.APP_STATE.NOT_INSTALLED;
31
- }
32
- if (!(await this.adb.processExists(appId))) {
33
- return helpers_1.APP_STATE.NOT_RUNNING;
34
- }
35
- const appIdRe = new RegExp(`\\b${lodash_1.default.escapeRegExp(appId)}/`);
36
- for (const line of (await this.adb.dumpWindows()).split('\n')) {
37
- if (appIdRe.test(line) && ['mCurrentFocus', 'mFocusedApp'].some((x) => line.includes(x))) {
38
- return helpers_1.APP_STATE.RUNNING_IN_FOREGROUND;
39
- }
40
- }
41
- return helpers_1.APP_STATE.RUNNING_IN_BACKGROUND;
42
- },
43
- async mobileQueryAppState(opts) {
44
- const { appId } = (0, utils_1.requireArgs)('appId', opts);
45
- return await this.queryAppState(appId);
46
- },
47
- async activateApp(appId) {
48
- this.log.debug(`Activating '${appId}'`);
49
- const apiLevel = await this.adb.getApiLevel();
50
- // Fallback to Monkey in older APIs
51
- if (apiLevel < 24) {
52
- // The monkey command could raise an issue as https://stackoverflow.com/questions/44860475/how-to-use-the-monkey-command-with-an-android-system-that-doesnt-have-physical
53
- // but '--pct-syskeys 0' could cause another background process issue. https://github.com/appium/appium/issues/16941#issuecomment-1129837285
54
- const cmd = ['monkey', '-p', appId, '-c', 'android.intent.category.LAUNCHER', '1'];
55
- let output = '';
56
- try {
57
- output = await this.adb.shell(cmd);
58
- this.log.debug(`Command stdout: ${output}`);
59
- }
60
- catch (e) {
61
- this.log.errorAndThrow(`Cannot activate '${appId}'. Original error: ${ /** @type {Error} */(e).message}`);
62
- }
63
- if (output.includes('monkey aborted')) {
64
- this.log.errorAndThrow(`Cannot activate '${appId}'. Are you sure it is installed?`);
65
- }
66
- return;
25
+ * @this {AndroidDriver}
26
+ * @param {string} appId
27
+ * @returns {Promise<boolean>}
28
+ */
29
+ async function isAppInstalled(appId) {
30
+ return await this.adb.isAppInstalled(appId);
31
+ }
32
+ exports.isAppInstalled = isAppInstalled;
33
+ /**
34
+ * @this {AndroidDriver}
35
+ * @param {import('./types').IsAppInstalledOpts} opts
36
+ * @returns {Promise<boolean>}
37
+ */
38
+ async function mobileIsAppInstalled(opts) {
39
+ const { appId } = (0, utils_1.requireArgs)('appId', opts);
40
+ return await this.isAppInstalled(appId);
41
+ }
42
+ exports.mobileIsAppInstalled = mobileIsAppInstalled;
43
+ /**
44
+ * @this {AndroidDriver}
45
+ * @param {string} appId
46
+ * @returns {Promise<import('./types').AppState>}
47
+ */
48
+ async function queryAppState(appId) {
49
+ this.log.info(`Querying the state of '${appId}'`);
50
+ if (!(await this.adb.isAppInstalled(appId))) {
51
+ return exports.APP_STATE.NOT_INSTALLED;
52
+ }
53
+ if (!(await this.adb.processExists(appId))) {
54
+ return exports.APP_STATE.NOT_RUNNING;
55
+ }
56
+ const appIdRe = new RegExp(`\\b${lodash_1.default.escapeRegExp(appId)}/`);
57
+ for (const line of (await this.adb.dumpWindows()).split('\n')) {
58
+ if (appIdRe.test(line) && ['mCurrentFocus', 'mFocusedApp'].some((x) => line.includes(x))) {
59
+ return exports.APP_STATE.RUNNING_IN_FOREGROUND;
67
60
  }
68
- let activityName = await this.adb.resolveLaunchableActivity(appId);
69
- if (activityName === RESOLVER_ACTIVITY_NAME) {
70
- // https://github.com/appium/appium/issues/17128
71
- this.log.debug(`The launchable activity name of '${appId}' was resolved to '${activityName}'. ` +
72
- `Switching the resolver to not use cmd`);
73
- activityName = await this.adb.resolveLaunchableActivity(appId, { preferCmd: false });
61
+ }
62
+ return exports.APP_STATE.RUNNING_IN_BACKGROUND;
63
+ }
64
+ exports.queryAppState = queryAppState;
65
+ /**
66
+ * @this {AndroidDriver}
67
+ * @param {import('./types').QueryAppStateOpts} opts
68
+ * @returns {Promise<import('./types').AppState>}
69
+ */
70
+ async function mobileQueryAppState(opts) {
71
+ const { appId } = (0, utils_1.requireArgs)('appId', opts);
72
+ return await this.queryAppState(appId);
73
+ }
74
+ exports.mobileQueryAppState = mobileQueryAppState;
75
+ /**
76
+ * @this {AndroidDriver}
77
+ * @param {string} appId
78
+ * @returns {Promise<void>}
79
+ */
80
+ async function activateApp(appId) {
81
+ this.log.debug(`Activating '${appId}'`);
82
+ const apiLevel = await this.adb.getApiLevel();
83
+ // Fallback to Monkey in older APIs
84
+ if (apiLevel < 24) {
85
+ // The monkey command could raise an issue as https://stackoverflow.com/questions/44860475/how-to-use-the-monkey-command-with-an-android-system-that-doesnt-have-physical
86
+ // but '--pct-syskeys 0' could cause another background process issue. https://github.com/appium/appium/issues/16941#issuecomment-1129837285
87
+ const cmd = ['monkey', '-p', appId, '-c', 'android.intent.category.LAUNCHER', '1'];
88
+ let output = '';
89
+ try {
90
+ output = await this.adb.shell(cmd);
91
+ this.log.debug(`Command stdout: ${output}`);
74
92
  }
75
- const stdout = await this.adb.shell([
76
- 'am',
77
- apiLevel < 26 ? 'start' : 'start-activity',
78
- '-a',
79
- 'android.intent.action.MAIN',
80
- '-c',
81
- 'android.intent.category.LAUNCHER',
82
- // FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
83
- // https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NEW_TASK
84
- // https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
85
- '-f',
86
- '0x10200000',
87
- '-n',
88
- activityName,
89
- ]);
90
- this.log.debug(stdout);
91
- if (/^error:/im.test(stdout)) {
92
- throw new Error(`Cannot activate '${appId}'. Original error: ${stdout}`);
93
+ catch (e) {
94
+ this.log.errorAndThrow(`Cannot activate '${appId}'. Original error: ${ /** @type {Error} */(e).message}`);
93
95
  }
94
- },
95
- async mobileActivateApp(opts) {
96
- const { appId } = (0, utils_1.requireArgs)('appId', opts);
97
- return await this.activateApp(appId);
98
- },
99
- async removeApp(appId, opts = {}) {
100
- return await this.adb.uninstallApk(appId, opts);
101
- },
102
- async mobileRemoveApp(opts) {
103
- const { appId } = (0, utils_1.requireArgs)('appId', opts);
104
- return await this.removeApp(appId, opts);
105
- },
106
- async terminateApp(appId, options = {}) {
107
- this.log.info(`Terminating '${appId}'`);
108
- if (!(await this.adb.processExists(appId))) {
109
- this.log.info(`The app '${appId}' is not running`);
110
- return false;
96
+ if (output.includes('monkey aborted')) {
97
+ this.log.errorAndThrow(`Cannot activate '${appId}'. Are you sure it is installed?`);
111
98
  }
112
- await this.adb.forceStop(appId);
113
- const timeout = support_1.util.hasValue(options.timeout) && !Number.isNaN(options.timeout)
114
- ? parseInt(String(options.timeout), 10)
115
- : 500;
116
- if (timeout <= 0) {
117
- this.log.info(`'${appId}' has been terminated. Skip checking the application process state ` +
118
- `since the timeout was set as ${timeout}ms`);
99
+ return;
100
+ }
101
+ let activityName = await this.adb.resolveLaunchableActivity(appId);
102
+ if (activityName === RESOLVER_ACTIVITY_NAME) {
103
+ // https://github.com/appium/appium/issues/17128
104
+ this.log.debug(`The launchable activity name of '${appId}' was resolved to '${activityName}'. ` +
105
+ `Switching the resolver to not use cmd`);
106
+ activityName = await this.adb.resolveLaunchableActivity(appId, { preferCmd: false });
107
+ }
108
+ const stdout = await this.adb.shell([
109
+ 'am',
110
+ apiLevel < 26 ? 'start' : 'start-activity',
111
+ '-a',
112
+ 'android.intent.action.MAIN',
113
+ '-c',
114
+ 'android.intent.category.LAUNCHER',
115
+ // FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
116
+ // https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_NEW_TASK
117
+ // https://developer.android.com/reference/android/content/Intent#FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
118
+ '-f',
119
+ '0x10200000',
120
+ '-n',
121
+ activityName,
122
+ ]);
123
+ this.log.debug(stdout);
124
+ if (/^error:/im.test(stdout)) {
125
+ throw new Error(`Cannot activate '${appId}'. Original error: ${stdout}`);
126
+ }
127
+ }
128
+ exports.activateApp = activateApp;
129
+ /**
130
+ * @this {AndroidDriver}
131
+ * @param {import('./types').ActivateAppOpts} opts
132
+ * @returns {Promise<void>}
133
+ */
134
+ async function mobileActivateApp(opts) {
135
+ const { appId } = (0, utils_1.requireArgs)('appId', opts);
136
+ return await this.activateApp(appId);
137
+ }
138
+ exports.mobileActivateApp = mobileActivateApp;
139
+ /**
140
+ * @this {AndroidDriver}
141
+ * @param {string} appId
142
+ * @param {Omit<import('appium-adb').UninstallOptions, 'appId'>} opts
143
+ * @returns {Promise<boolean>}
144
+ */
145
+ async function removeApp(appId, opts = {}) {
146
+ return await this.adb.uninstallApk(appId, opts);
147
+ }
148
+ exports.removeApp = removeApp;
149
+ /**
150
+ * @this {import('../driver').AndroidDriver}
151
+ * @param {import('./types').RemoveAppOpts} opts
152
+ * @returns {Promise<boolean>}
153
+ */
154
+ async function mobileRemoveApp(opts) {
155
+ const { appId } = (0, utils_1.requireArgs)('appId', opts);
156
+ return await this.removeApp(appId, opts);
157
+ }
158
+ exports.mobileRemoveApp = mobileRemoveApp;
159
+ /**
160
+ * @this {AndroidDriver}
161
+ * @param {string} appId
162
+ * @param {Omit<import('./types').TerminateAppOpts, 'appId'>} [options={}]
163
+ * @returns {Promise<boolean>}
164
+ */
165
+ async function terminateApp(appId, options = {}) {
166
+ this.log.info(`Terminating '${appId}'`);
167
+ if (!(await this.adb.processExists(appId))) {
168
+ this.log.info(`The app '${appId}' is not running`);
169
+ return false;
170
+ }
171
+ await this.adb.forceStop(appId);
172
+ const timeout = support_1.util.hasValue(options.timeout) && !Number.isNaN(options.timeout)
173
+ ? parseInt(String(options.timeout), 10)
174
+ : 500;
175
+ if (timeout <= 0) {
176
+ this.log.info(`'${appId}' has been terminated. Skip checking the application process state ` +
177
+ `since the timeout was set as ${timeout}ms`);
178
+ return true;
179
+ }
180
+ try {
181
+ await (0, asyncbox_1.waitForCondition)(async () => (await this.queryAppState(appId)) <= exports.APP_STATE.NOT_RUNNING, {
182
+ waitMs: timeout,
183
+ intervalMs: 100,
184
+ });
185
+ }
186
+ catch (e) {
187
+ this.log.errorAndThrow(`'${appId}' is still running after ${timeout}ms timeout`);
188
+ }
189
+ this.log.info(`'${appId}' has been successfully terminated`);
190
+ return true;
191
+ }
192
+ exports.terminateApp = terminateApp;
193
+ /**
194
+ * @this {AndroidDriver}
195
+ * @param {import('./types').TerminateAppOpts} opts
196
+ * @returns {Promise<boolean>}
197
+ */
198
+ async function mobileTerminateApp(opts) {
199
+ const { appId } = (0, utils_1.requireArgs)('appId', opts);
200
+ return await this.terminateApp(appId, opts);
201
+ }
202
+ exports.mobileTerminateApp = mobileTerminateApp;
203
+ /**
204
+ * @this {AndroidDriver}
205
+ * @param {string} appPath
206
+ * @param {Omit<import('appium-adb').InstallOptions, 'appId'>} opts
207
+ * @returns {Promise<void>}
208
+ */
209
+ async function installApp(appPath, opts) {
210
+ const localPath = await this.helpers.configureApp(appPath, APP_EXTENSIONS);
211
+ await this.adb.install(localPath, opts);
212
+ }
213
+ exports.installApp = installApp;
214
+ /**
215
+ * @this {AndroidDriver}
216
+ * @param {import('./types').InstallAppOpts} opts
217
+ * @returns {Promise<void>}
218
+ */
219
+ async function mobileInstallApp(opts) {
220
+ const { appPath } = (0, utils_1.requireArgs)('appPath', opts);
221
+ return await this.installApp(appPath, opts);
222
+ }
223
+ exports.mobileInstallApp = mobileInstallApp;
224
+ /**
225
+ * @this {AndroidDriver}
226
+ * @param {import('./types').ClearAppOpts} opts
227
+ * @returns {Promise<void>}
228
+ */
229
+ async function mobileClearApp(opts) {
230
+ const { appId } = (0, utils_1.requireArgs)('appId', opts);
231
+ await this.adb.clear(appId);
232
+ }
233
+ exports.mobileClearApp = mobileClearApp;
234
+ /**
235
+ * @this {AndroidDriver}
236
+ * @returns {Promise<string>}
237
+ */
238
+ async function getCurrentActivity() {
239
+ return /** @type {string} */ ((await this.adb.getFocusedPackageAndActivity()).appActivity);
240
+ }
241
+ exports.getCurrentActivity = getCurrentActivity;
242
+ /**
243
+ * @this {AndroidDriver}
244
+ * @returns {Promise<string>}
245
+ */
246
+ async function getCurrentPackage() {
247
+ return /** @type {string} */ ((await this.adb.getFocusedPackageAndActivity()).appPackage);
248
+ }
249
+ exports.getCurrentPackage = getCurrentPackage;
250
+ /**
251
+ * @this {AndroidDriver}
252
+ * @param {number} seconds
253
+ * @returns {Promise<string|true>}
254
+ */
255
+ async function background(seconds) {
256
+ if (seconds < 0) {
257
+ // if user passes in a negative seconds value, interpret that as the instruction
258
+ // to not bring the app back at all
259
+ await this.adb.goToHome();
260
+ return true;
261
+ }
262
+ let { appPackage, appActivity } = await this.adb.getFocusedPackageAndActivity();
263
+ await this.adb.goToHome();
264
+ // people can wait for a long time, so to be safe let's use the longSleep function and log
265
+ // progress periodically.
266
+ const sleepMs = seconds * 1000;
267
+ const thresholdMs = 30 * 1000; // use the spin-wait for anything over this threshold
268
+ // for our spin interval, use 1% of the total wait time, but nothing bigger than 30s
269
+ const intervalMs = lodash_1.default.min([30 * 1000, parseInt(String(sleepMs / 100), 10)]);
270
+ /**
271
+ *
272
+ * @param {{elapsedMs: number, progress: number}} param0
273
+ */
274
+ const progressCb = ({ elapsedMs, progress }) => {
275
+ const waitSecs = (elapsedMs / 1000).toFixed(0);
276
+ const progressPct = (progress * 100).toFixed(2);
277
+ this.log.debug(`Waited ${waitSecs}s so far (${progressPct}%)`);
278
+ };
279
+ await (0, asyncbox_1.longSleep)(sleepMs, { thresholdMs, intervalMs, progressCb });
280
+ /** @type {import('appium-adb').StartAppOptions} */
281
+ let args;
282
+ if (this._cachedActivityArgs && this._cachedActivityArgs[`${appPackage}/${appActivity}`]) {
283
+ // the activity was started with `startActivity`, so use those args to restart
284
+ args = this._cachedActivityArgs[`${appPackage}/${appActivity}`];
285
+ }
286
+ else {
287
+ try {
288
+ this.log.debug(`Activating app '${appPackage}' in order to restore it`);
289
+ await this.activateApp(/** @type {string} */ (appPackage));
119
290
  return true;
120
291
  }
292
+ catch (ign) { }
293
+ args =
294
+ (appPackage === this.opts.appPackage && appActivity === this.opts.appActivity) ||
295
+ (appPackage === this.opts.appWaitPackage &&
296
+ (this.opts.appWaitActivity || '').split(',').includes(String(appActivity)))
297
+ ? {
298
+ // the activity is the original session activity, so use the original args
299
+ pkg: /** @type {string} */ (this.opts.appPackage),
300
+ activity: this.opts.appActivity ?? undefined,
301
+ action: this.opts.intentAction,
302
+ category: this.opts.intentCategory,
303
+ flags: this.opts.intentFlags,
304
+ waitPkg: this.opts.appWaitPackage ?? undefined,
305
+ waitActivity: this.opts.appWaitActivity ?? undefined,
306
+ waitForLaunch: this.opts.appWaitForLaunch,
307
+ waitDuration: this.opts.appWaitDuration,
308
+ optionalIntentArguments: this.opts.optionalIntentArguments,
309
+ stopApp: false,
310
+ user: this.opts.userProfile,
311
+ }
312
+ : {
313
+ // the activity was started some other way, so use defaults
314
+ pkg: /** @type {string} */ (appPackage),
315
+ activity: appActivity ?? undefined,
316
+ waitPkg: appPackage ?? undefined,
317
+ waitActivity: appActivity ?? undefined,
318
+ stopApp: false,
319
+ };
320
+ }
321
+ args = /** @type {import('appium-adb').StartAppOptions} */ (lodash_1.default.pickBy(args, (value) => !lodash_1.default.isUndefined(value)));
322
+ this.log.debug(`Bringing application back to foreground with arguments: ${JSON.stringify(args)}`);
323
+ return await this.adb.startApp(args);
324
+ }
325
+ exports.background = background;
326
+ /**
327
+ * @this {AndroidDriver}
328
+ * @param {import('../driver').AndroidDriverOpts?} [opts=null]
329
+ * @returns {Promise<void>}
330
+ */
331
+ async function resetApp(opts = null) {
332
+ const { app, appPackage, fastReset, fullReset, androidInstallTimeout = PACKAGE_INSTALL_TIMEOUT_MS, autoGrantPermissions, allowTestPackages, } = opts ?? this.opts;
333
+ if (!appPackage) {
334
+ throw new Error("'appPackage' option is required");
335
+ }
336
+ const isInstalled = await this.adb.isAppInstalled(appPackage);
337
+ if (isInstalled) {
121
338
  try {
122
- await (0, asyncbox_1.waitForCondition)(async () => (await this.queryAppState(appId)) <= helpers_1.APP_STATE.NOT_RUNNING, { waitMs: timeout, intervalMs: 100 });
339
+ await this.adb.forceStop(appPackage);
123
340
  }
124
- catch (e) {
125
- this.log.errorAndThrow(`'${appId}' is still running after ${timeout}ms timeout`);
341
+ catch (ign) { }
342
+ // fullReset has priority over fastReset
343
+ if (!fullReset && fastReset) {
344
+ const output = await this.adb.clear(appPackage);
345
+ if (lodash_1.default.isString(output) && output.toLowerCase().includes('failed')) {
346
+ throw new Error(`Cannot clear the application data of '${appPackage}'. Original error: ${output}`);
347
+ }
348
+ // executing `shell pm clear` resets previously assigned application permissions as well
349
+ if (autoGrantPermissions) {
350
+ try {
351
+ await this.adb.grantAllPermissions(appPackage);
352
+ }
353
+ catch (error) {
354
+ this.log.error(`Unable to grant permissions requested. Original error: ${error.message}`);
355
+ }
356
+ }
357
+ this.log.debug(`Performed fast reset on the installed '${appPackage}' application (stop and clear)`);
358
+ return;
126
359
  }
127
- this.log.info(`'${appId}' has been successfully terminated`);
128
- return true;
129
- },
130
- async mobileTerminateApp(opts) {
131
- const { appId } = (0, utils_1.requireArgs)('appId', opts);
132
- return await this.terminateApp(appId, opts);
133
- },
134
- async installApp(appPath, opts) {
135
- const localPath = await this.helpers.configureApp(appPath, APP_EXTENSIONS);
136
- await this.adb.install(localPath, opts);
137
- },
138
- async mobileInstallApp(opts) {
139
- const { appPath } = (0, utils_1.requireArgs)('appPath', opts);
140
- return await this.installApp(appPath, opts);
141
- },
142
- async mobileClearApp(opts) {
143
- const { appId } = (0, utils_1.requireArgs)('appId', opts);
144
- await this.adb.clear(appId);
145
- },
146
- };
147
- (0, mixins_1.mixin)(AppManagementMixin);
148
- exports.default = AppManagementMixin;
360
+ }
361
+ if (!app) {
362
+ throw new Error(`Either provide 'app' option to install '${appPackage}' or ` +
363
+ `consider setting 'noReset' to 'true' if '${appPackage}' is supposed to be preinstalled.`);
364
+ }
365
+ this.log.debug(`Running full reset on '${appPackage}' (reinstall)`);
366
+ if (isInstalled) {
367
+ await this.adb.uninstallApk(appPackage);
368
+ }
369
+ await this.adb.install(app, {
370
+ grantPermissions: autoGrantPermissions,
371
+ timeout: androidInstallTimeout,
372
+ allowTestPackages,
373
+ });
374
+ }
375
+ exports.resetApp = resetApp;
376
+ async function installApk(opts = null) {
377
+ const { app, appPackage, fastReset, fullReset, androidInstallTimeout = PACKAGE_INSTALL_TIMEOUT_MS, autoGrantPermissions, allowTestPackages, enforceAppInstall, } = opts ?? this.opts;
378
+ if (!app || !appPackage) {
379
+ throw new Error("'app' and 'appPackage' options are required");
380
+ }
381
+ if (fullReset) {
382
+ await this.resetApp(opts);
383
+ return;
384
+ }
385
+ const { appState, wasUninstalled } = await this.adb.installOrUpgrade(app, appPackage, {
386
+ grantPermissions: autoGrantPermissions,
387
+ timeout: androidInstallTimeout,
388
+ allowTestPackages,
389
+ enforceCurrentBuild: enforceAppInstall,
390
+ });
391
+ // There is no need to reset the newly installed app
392
+ const isInstalledOverExistingApp = !wasUninstalled && appState !== this.adb.APP_INSTALL_STATE.NOT_INSTALLED;
393
+ if (fastReset && isInstalledOverExistingApp) {
394
+ this.log.info(`Performing fast reset on '${appPackage}'`);
395
+ await this.resetApp(opts);
396
+ }
397
+ }
398
+ exports.installApk = installApk;
399
+ /**
400
+ * @this {AndroidDriver}
401
+ * @param {string[]} otherApps
402
+ * @param {import('../driver').AndroidDriverOpts?} [opts=null]
403
+ * @returns {Promise<void>}
404
+ */
405
+ async function installOtherApks(otherApps, opts = null) {
406
+ const { androidInstallTimeout = PACKAGE_INSTALL_TIMEOUT_MS, autoGrantPermissions, allowTestPackages, } = opts ?? this.opts;
407
+ // Install all of the APK's asynchronously
408
+ await bluebird_1.default.all(otherApps.map((otherApp) => {
409
+ this.log.debug(`Installing app: ${otherApp}`);
410
+ return this.adb.installOrUpgrade(otherApp, undefined, {
411
+ grantPermissions: autoGrantPermissions,
412
+ timeout: androidInstallTimeout,
413
+ allowTestPackages,
414
+ });
415
+ }));
416
+ }
417
+ exports.installOtherApks = installOtherApks;
418
+ /**
419
+ * @this {AndroidDriver}
420
+ * @param {string[]} appPackages
421
+ * @param {string[]} [filterPackages=[]]
422
+ * @returns {Promise<void>}
423
+ */
424
+ async function uninstallOtherPackages(appPackages, filterPackages = []) {
425
+ if (appPackages.includes('*')) {
426
+ this.log.debug('Uninstall third party packages');
427
+ appPackages = await getThirdPartyPackages.bind(this)(filterPackages);
428
+ }
429
+ this.log.debug(`Uninstalling packages: ${appPackages}`);
430
+ await bluebird_1.default.all(appPackages.map((appPackage) => this.adb.uninstallApk(appPackage)));
431
+ }
432
+ exports.uninstallOtherPackages = uninstallOtherPackages;
433
+ /**
434
+ * @this {AndroidDriver}
435
+ * @param {string[]} [filterPackages=[]]
436
+ * @returns {Promise<string[]>}
437
+ */
438
+ async function getThirdPartyPackages(filterPackages = []) {
439
+ try {
440
+ const packagesString = await this.adb.shell(['pm', 'list', 'packages', '-3']);
441
+ const appPackagesArray = packagesString
442
+ .trim()
443
+ .replace(/package:/g, '')
444
+ .split(node_os_1.EOL);
445
+ this.log.debug(`'${appPackagesArray}' filtered with '${filterPackages}'`);
446
+ return lodash_1.default.difference(appPackagesArray, filterPackages);
447
+ }
448
+ catch (err) {
449
+ this.log.warn(`Unable to get packages with 'adb shell pm list packages -3': ${err.message}`);
450
+ return [];
451
+ }
452
+ }
453
+ exports.getThirdPartyPackages = getThirdPartyPackages;
149
454
  /**
150
- * @typedef {import('appium-adb').ADB} ADB
455
+ * @typedef {import('../driver').AndroidDriver} AndroidDriver
151
456
  */
152
457
  //# sourceMappingURL=app-management.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-management.js","sourceRoot":"","sources":["../../../lib/commands/app-management.js"],"names":[],"mappings":";AAAA,YAAY;;;;;AAEZ,6CAAqC;AACrC,uCAA0C;AAC1C,oDAAuB;AACvB,wCAAqC;AACrC,oCAAqC;AACrC,qCAA+B;AAE/B,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACzC,MAAM,sBAAsB,GAAG,mDAAmD,CAAC;AAEnF;;;GAGG;AACH,MAAM,kBAAkB,GAAG;IACzB,KAAK,CAAC,cAAc,CAAC,KAAK;QACxB,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,IAAI;QAC7B,MAAM,EAAC,KAAK,EAAC,GAAG,IAAA,mBAAW,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC3C,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,KAAK;QACvB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,0BAA0B,KAAK,GAAG,CAAC,CAAC;QAClD,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,EA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G,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC;QAC9E,MAAM,gBAAgB,GAAG,cAAc;aACpC,IAAI,EAAE;aACN,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;aACxB,KAAK,CAAC,aAAG,CAAC,CAAC;QACd,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,gBAAgB,oBAAoB,cAAc,GAAG,CAAC,CAAC;QAC1E,OAAO,gBAAC,CAAC,UAAU,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;KACvD;IAAC,OAAO,GAAG,EAAE;QACZ,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,gEAAgE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QAC7F,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AAbD,sDAaC;AAED;;GAEG"}
@@ -1,7 +1,20 @@
1
- export default AppearanceMixin;
2
1
  /**
3
- * @type {import('./mixins').AppearanceMixin & ThisType<import('../driver').AndroidDriver>}
4
- * @satisfies {import('@appium/types').ExternalDriver}
2
+ * Set the Ui appearance.
3
+ *
4
+ * @since Android 10
5
+ * @this {import('../driver').AndroidDriver}
6
+ * @property {import('./types').SetUiModeOpts}
7
+ * @returns {Promise<void>}
5
8
  */
6
- declare const AppearanceMixin: import('./mixins').AppearanceMixin & ThisType<import('../driver').AndroidDriver>;
9
+ export function mobileSetUiMode(this: import("../driver").AndroidDriver, opts: any): Promise<void>;
10
+ /**
11
+ * Get the Ui appearance.
12
+ *
13
+ * @since Android 10
14
+ * @this {import('../driver').AndroidDriver}
15
+ * @property {import('./types').GetUiModeOpts}
16
+ * @returns {Promise<string>} The actual state for the queried UI mode,
17
+ * for example 'yes' or 'no'
18
+ */
19
+ export function mobileGetUiMode(this: import("../driver").AndroidDriver, opts: any): Promise<string>;
7
20
  //# sourceMappingURL=appearance.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"appearance.d.ts","sourceRoot":"","sources":["../../../lib/commands/appearance.js"],"names":[],"mappings":";AAKA;;;GAGG;AACH,+BAHU,OAAO,UAAU,EAAE,eAAe,GAAG,SAAS,OAAO,WAAW,EAAE,aAAa,CAAC,CAgCxF"}
1
+ {"version":3,"file":"appearance.d.ts","sourceRoot":"","sources":["../../../lib/commands/appearance.js"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,qFAFa,QAAQ,IAAI,CAAC,CAKzB;AAED;;;;;;;;GAQG;AACH,qFAHa,QAAQ,MAAM,CAAC,CAY3B"}