appium-uiautomator2-driver 2.44.2 → 2.45.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/lib/driver.ts CHANGED
@@ -372,6 +372,16 @@ class AndroidUiautomator2Driver
372
372
  };
373
373
  _.defaults(this.opts, defaultOpts);
374
374
 
375
+ this.opts.adbPort = this.opts.adbPort || DEFAULT_ADB_PORT;
376
+ // get device udid for this session
377
+ const {udid, emPort} = await this.getDeviceInfoFromCaps();
378
+ this.opts.udid = udid;
379
+ // @ts-expect-error do not put random stuff on opts
380
+ this.opts.emPort = emPort;
381
+ // now that we know our java version and device info, we can create our
382
+ // ADB instance
383
+ this.adb = await this.createADB();
384
+
375
385
  if (this.isChromeSession) {
376
386
  this.log.info(`We're going to run a Chrome-based session`);
377
387
  const {pkg, activity: defaultActivity} = utils.getChromePkg(this.opts.browserName!);
@@ -405,7 +415,6 @@ class AndroidUiautomator2Driver
405
415
  'without the target application'
406
416
  );
407
417
  }
408
- this.opts.adbPort = this.opts.adbPort || DEFAULT_ADB_PORT;
409
418
 
410
419
  const result = await this.startUiAutomator2Session(startSessionOpts);
411
420
 
@@ -659,16 +668,6 @@ class AndroidUiautomator2Driver
659
668
  async startUiAutomator2Session(
660
669
  caps: Uiautomator2StartSessionOpts
661
670
  ): Promise<Uiautomator2SessionCaps> {
662
- // get device udid for this session
663
- const {udid, emPort} = await this.getDeviceInfoFromCaps();
664
- this.opts.udid = udid;
665
- // @ts-expect-error do not put random stuff on opts
666
- this.opts.emPort = emPort;
667
-
668
- // now that we know our java version and device info, we can create our
669
- // ADB instance
670
- this.adb = await this.createADB();
671
-
672
671
  const appInfo = await this.performSessionPreExecSetup();
673
672
  // set actual device name, udid, platform version, screen size, screen density, model and manufacturer details
674
673
  const sessionInfo: Uiautomator2SessionInfo = {
@@ -278,7 +278,7 @@ export const executeMethodMap = {
278
278
  command: 'mobileInstallApp',
279
279
  params: {
280
280
  required: ['appPath'],
281
- optional: ['timeout', 'keepData'],
281
+ optional: ['timeout', 'allowTestPackages', 'useSdcard', 'grantPermissions', 'replace', 'checkVersion'],
282
282
  },
283
283
  },
284
284
  'mobile: clearApp': {