@midscene/android 1.0.1-beta-20251208112226.0 → 1.0.1-beta-20251209024153.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/dist/es/index.mjs CHANGED
@@ -787,7 +787,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
787
787
  const adb = await this.getAdb();
788
788
  await adb.shell(`input${this.getDisplayArg()} keyevent 187`);
789
789
  }
790
- async longPress(x, y, duration = 1000) {
790
+ async longPress(x, y, duration = 2000) {
791
791
  const adb = await this.getAdb();
792
792
  const { x: adjustedX, y: adjustedY } = this.adjustCoordinates(x, y);
793
793
  await adb.shell(`input${this.getDisplayArg()} swipe ${adjustedX} ${adjustedY} ${adjustedX} ${adjustedY} ${duration}`);
@@ -997,6 +997,7 @@ class AndroidAgent extends Agent {
997
997
  async function agentFromAdbDevice(deviceId, opts) {
998
998
  if (!deviceId) {
999
999
  const devices = await getConnectedDevices();
1000
+ if (0 === devices.length) throw new Error('No Android devices found. Please connect an Android device and ensure ADB is properly configured. Run `adb devices` to verify device connection.');
1000
1001
  deviceId = devices[0].udid;
1001
1002
  debugAgent('deviceId not specified, will use the first device (id = %s)', deviceId);
1002
1003
  }
package/dist/lib/index.js CHANGED
@@ -833,7 +833,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
833
833
  const adb = await this.getAdb();
834
834
  await adb.shell(`input${this.getDisplayArg()} keyevent 187`);
835
835
  }
836
- async longPress(x, y, duration = 1000) {
836
+ async longPress(x, y, duration = 2000) {
837
837
  const adb = await this.getAdb();
838
838
  const { x: adjustedX, y: adjustedY } = this.adjustCoordinates(x, y);
839
839
  await adb.shell(`input${this.getDisplayArg()} swipe ${adjustedX} ${adjustedY} ${adjustedX} ${adjustedY} ${duration}`);
@@ -1044,6 +1044,7 @@ class AndroidAgent extends agent_namespaceObject.Agent {
1044
1044
  async function agentFromAdbDevice(deviceId, opts) {
1045
1045
  if (!deviceId) {
1046
1046
  const devices = await getConnectedDevices();
1047
+ if (0 === devices.length) throw new Error('No Android devices found. Please connect an Android device and ensure ADB is properly configured. Run `adb devices` to verify device connection.');
1047
1048
  deviceId = devices[0].udid;
1048
1049
  debugAgent('deviceId not specified, will use the first device (id = %s)', deviceId);
1049
1050
  }
@@ -1056,13 +1057,13 @@ exports.AndroidDevice = __webpack_exports__.AndroidDevice;
1056
1057
  exports.agentFromAdbDevice = __webpack_exports__.agentFromAdbDevice;
1057
1058
  exports.getConnectedDevices = __webpack_exports__.getConnectedDevices;
1058
1059
  exports.overrideAIConfig = __webpack_exports__.overrideAIConfig;
1059
- for(var __webpack_i__ in __webpack_exports__)if (-1 === [
1060
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
1060
1061
  "AndroidAgent",
1061
1062
  "AndroidDevice",
1062
1063
  "agentFromAdbDevice",
1063
1064
  "getConnectedDevices",
1064
1065
  "overrideAIConfig"
1065
- ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
1066
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
1066
1067
  Object.defineProperty(exports, '__esModule', {
1067
1068
  value: true
1068
1069
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/android",
3
- "version": "1.0.1-beta-20251208112226.0",
3
+ "version": "1.0.1-beta-20251209024153.0",
4
4
  "description": "Android automation library for Midscene",
5
5
  "keywords": [
6
6
  "Android UI automation",
@@ -27,18 +27,18 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "appium-adb": "12.12.1",
30
- "@midscene/core": "1.0.1-beta-20251208112226.0",
31
- "@midscene/shared": "1.0.1-beta-20251208112226.0"
30
+ "@midscene/core": "1.0.1-beta-20251209024153.0",
31
+ "@midscene/shared": "1.0.1-beta-20251209024153.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@rslib/core": "^0.18.2",
34
+ "@rslib/core": "^0.18.3",
35
35
  "@types/node": "^18.0.0",
36
36
  "dotenv": "^16.4.5",
37
37
  "typescript": "^5.8.3",
38
38
  "tsx": "^4.19.2",
39
39
  "vitest": "3.0.5",
40
40
  "zod": "3.24.3",
41
- "@midscene/playground": "1.0.1-beta-20251208112226.0"
41
+ "@midscene/playground": "1.0.1-beta-20251209024153.0"
42
42
  },
43
43
  "license": "MIT",
44
44
  "scripts": {