@midscene/android 0.24.1 → 0.24.2-beta-20250730081235.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.
@@ -79,6 +79,7 @@ declare class AndroidDevice implements AndroidDevicePage {
79
79
  back(): Promise<void>;
80
80
  home(): Promise<void>;
81
81
  recentApps(): Promise<void>;
82
+ longPress(x: number, y: number, duration?: number): Promise<void>;
82
83
  getXpathsById(id: string): Promise<string[]>;
83
84
  getElementInfoByXpath(xpath: string): Promise<ElementInfo>;
84
85
  }
package/dist/es/index.js CHANGED
@@ -570,6 +570,13 @@ ${Object.keys(size).filter((key) => size[key]).map(
570
570
  const adb = await this.getAdb();
571
571
  await adb.shell("input keyevent 187");
572
572
  }
573
+ async longPress(x, y, duration = 1e3) {
574
+ const adb = await this.getAdb();
575
+ const { x: adjustedX, y: adjustedY } = this.adjustCoordinates(x, y);
576
+ await adb.shell(
577
+ `input swipe ${adjustedX} ${adjustedY} ${adjustedX} ${adjustedY} ${duration}`
578
+ );
579
+ }
573
580
  async getXpathsById(id) {
574
581
  throw new Error("Not implemented");
575
582
  }
@@ -79,6 +79,7 @@ declare class AndroidDevice implements AndroidDevicePage {
79
79
  back(): Promise<void>;
80
80
  home(): Promise<void>;
81
81
  recentApps(): Promise<void>;
82
+ longPress(x: number, y: number, duration?: number): Promise<void>;
82
83
  getXpathsById(id: string): Promise<string[]>;
83
84
  getElementInfoByXpath(xpath: string): Promise<ElementInfo>;
84
85
  }
package/dist/lib/index.js CHANGED
@@ -597,6 +597,13 @@ ${Object.keys(size).filter((key) => size[key]).map(
597
597
  const adb = await this.getAdb();
598
598
  await adb.shell("input keyevent 187");
599
599
  }
600
+ async longPress(x, y, duration = 1e3) {
601
+ const adb = await this.getAdb();
602
+ const { x: adjustedX, y: adjustedY } = this.adjustCoordinates(x, y);
603
+ await adb.shell(
604
+ `input swipe ${adjustedX} ${adjustedY} ${adjustedX} ${adjustedY} ${duration}`
605
+ );
606
+ }
600
607
  async getXpathsById(id) {
601
608
  throw new Error("Not implemented");
602
609
  }
@@ -79,6 +79,7 @@ declare class AndroidDevice implements AndroidDevicePage {
79
79
  back(): Promise<void>;
80
80
  home(): Promise<void>;
81
81
  recentApps(): Promise<void>;
82
+ longPress(x: number, y: number, duration?: number): Promise<void>;
82
83
  getXpathsById(id: string): Promise<string[]>;
83
84
  getElementInfoByXpath(xpath: string): Promise<ElementInfo>;
84
85
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/android",
3
- "version": "0.24.1",
3
+ "version": "0.24.2-beta-20250730081235.0",
4
4
  "description": "Android automation library for Midscene",
5
5
  "keywords": [
6
6
  "Android UI automation",
@@ -25,9 +25,9 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "appium-adb": "12.12.1",
28
- "@midscene/shared": "0.24.1",
29
- "@midscene/web": "0.24.1",
30
- "@midscene/core": "0.24.1"
28
+ "@midscene/core": "0.24.2-beta-20250730081235.0",
29
+ "@midscene/shared": "0.24.2-beta-20250730081235.0",
30
+ "@midscene/web": "0.24.2-beta-20250730081235.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@modern-js/module-tools": "2.60.6",