mobile-mcp-ai 2.5.5__py3-none-any.whl → 2.5.6__py3-none-any.whl

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.
mobile_mcp/__init__.py CHANGED
@@ -22,7 +22,7 @@
22
22
  await client.type_text("用户名输入框", "test@example.com")
23
23
  """
24
24
 
25
- __version__ = "2.5.5"
25
+ __version__ = "1.0.0"
26
26
 
27
27
  from .core.mobile_client import MobileClient
28
28
  from .core.device_manager import DeviceManager
@@ -2360,22 +2360,43 @@ class BasicMobileToolsLite:
2360
2360
  return 0.5
2361
2361
 
2362
2362
  def assert_text(self, text: str) -> Dict:
2363
- """检查页面是否包含文本"""
2363
+ """检查页面是否包含文本(支持精确匹配和包含匹配)"""
2364
2364
  try:
2365
+ exists = False
2366
+ match_type = ""
2367
+
2365
2368
  if self._is_ios():
2366
2369
  ios_client = self._get_ios_client()
2367
2370
  if ios_client and hasattr(ios_client, 'wda'):
2368
- exists = ios_client.wda(name=text).exists or ios_client.wda(label=text).exists
2369
- else:
2370
- exists = False
2371
+ # 先尝试精确匹配
2372
+ if ios_client.wda(name=text).exists or ios_client.wda(label=text).exists:
2373
+ exists = True
2374
+ match_type = "精确匹配"
2375
+ # 再尝试包含匹配
2376
+ elif ios_client.wda(nameContains=text).exists or ios_client.wda(labelContains=text).exists:
2377
+ exists = True
2378
+ match_type = "包含匹配"
2379
+ else:
2380
+ # Android: 先尝试精确匹配
2381
+ if self.client.u2(text=text).exists():
2382
+ exists = True
2383
+ match_type = "精确匹配"
2384
+ # 再尝试包含匹配
2385
+ elif self.client.u2(textContains=text).exists():
2386
+ exists = True
2387
+ match_type = "包含匹配"
2388
+
2389
+ if exists:
2390
+ message = f"✅ 文本'{text}' 存在({match_type})"
2371
2391
  else:
2372
- exists = self.client.u2(text=text).exists()
2392
+ message = f"❌ 文本'{text}' 不存在"
2373
2393
 
2374
2394
  return {
2375
2395
  "success": True,
2376
2396
  "found": exists,
2377
2397
  "text": text,
2378
- "message": f"✅ 文本'{text}' {'存在' if exists else '不存在'}"
2398
+ "match_type": match_type if exists else None,
2399
+ "message": message
2379
2400
  }
2380
2401
  except Exception as e:
2381
2402
  return {"success": False, "message": f"❌ 断言失败: {e}"}
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.1
2
2
  Name: mobile-mcp-ai
3
- Version: 2.5.5
3
+ Version: 2.5.6
4
4
  Summary: 移动端自动化 MCP Server - 支持 Android/iOS,AI 功能可选(基础工具不需要 AI)
5
5
  Home-page: https://github.com/test111ddff-hash/mobile-mcp-ai
6
6
  Author: douzi
@@ -31,21 +31,6 @@ Provides-Extra: ai
31
31
  Requires-Dist: dashscope>=1.10.0; extra == "ai"
32
32
  Requires-Dist: openai>=1.0.0; extra == "ai"
33
33
  Requires-Dist: anthropic>=0.3.0; extra == "ai"
34
- Provides-Extra: test
35
- Requires-Dist: pytest>=8.0.0; extra == "test"
36
- Requires-Dist: pytest-asyncio>=0.21.0; extra == "test"
37
- Requires-Dist: allure-pytest>=2.13.0; extra == "test"
38
- Provides-Extra: dev
39
- Requires-Dist: pytest>=8.0.0; extra == "dev"
40
- Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
41
- Requires-Dist: twine>=4.0.0; extra == "dev"
42
- Requires-Dist: build>=0.10.0; extra == "dev"
43
- Provides-Extra: ios
44
- Requires-Dist: tidevice>=0.11.0; extra == "ios"
45
- Requires-Dist: facebook-wda>=1.4.0; extra == "ios"
46
- Provides-Extra: h5
47
- Requires-Dist: Appium-Python-Client>=3.0.0; extra == "h5"
48
- Requires-Dist: selenium>=4.0.0; extra == "h5"
49
34
  Provides-Extra: all
50
35
  Requires-Dist: dashscope>=1.10.0; extra == "all"
51
36
  Requires-Dist: openai>=1.0.0; extra == "all"
@@ -55,19 +40,21 @@ Requires-Dist: selenium>=4.0.0; extra == "all"
55
40
  Requires-Dist: pytest>=8.0.0; extra == "all"
56
41
  Requires-Dist: pytest-asyncio>=0.21.0; extra == "all"
57
42
  Requires-Dist: allure-pytest>=2.13.0; extra == "all"
58
- Dynamic: author
59
- Dynamic: author-email
60
- Dynamic: classifier
61
- Dynamic: description
62
- Dynamic: description-content-type
63
- Dynamic: home-page
64
- Dynamic: keywords
65
- Dynamic: license-file
66
- Dynamic: project-url
67
- Dynamic: provides-extra
68
- Dynamic: requires-dist
69
- Dynamic: requires-python
70
- Dynamic: summary
43
+ Provides-Extra: dev
44
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
45
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
46
+ Requires-Dist: twine>=4.0.0; extra == "dev"
47
+ Requires-Dist: build>=0.10.0; extra == "dev"
48
+ Provides-Extra: h5
49
+ Requires-Dist: Appium-Python-Client>=3.0.0; extra == "h5"
50
+ Requires-Dist: selenium>=4.0.0; extra == "h5"
51
+ Provides-Extra: ios
52
+ Requires-Dist: tidevice>=0.11.0; extra == "ios"
53
+ Requires-Dist: facebook-wda>=1.4.0; extra == "ios"
54
+ Provides-Extra: test
55
+ Requires-Dist: pytest>=8.0.0; extra == "test"
56
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "test"
57
+ Requires-Dist: allure-pytest>=2.13.0; extra == "test"
71
58
 
72
59
  # 📱 Mobile MCP AI
73
60
 
@@ -1,7 +1,7 @@
1
- mobile_mcp/__init__.py,sha256=8FmpYKR75HYmrgWwCgzV4iellF0FMwSxfoy9u_fzioU,816
1
+ mobile_mcp/__init__.py,sha256=sQJZTL_sxQFzmcS7jOtS2AHCfUySz40vhX96N6u1qy4,816
2
2
  mobile_mcp/config.py,sha256=yaFLAV4bc2wX0GQPtZDo7OYF9E88tXV-av41fQsJwK4,4480
3
3
  mobile_mcp/core/__init__.py,sha256=ndMy-cLAIsQDG5op7gM_AIplycqZSZPWEkec1pEhvEY,170
4
- mobile_mcp/core/basic_tools_lite.py,sha256=rvVCCQEtVhLt24lBgaXMdG0ATb4O89lXEiczD3IrA1w,151423
4
+ mobile_mcp/core/basic_tools_lite.py,sha256=BgzErXm0jfYaVK8Se8vCvMXqCudEnUYWI3yivyzxktg,152356
5
5
  mobile_mcp/core/device_manager.py,sha256=PX3-B5bJFnKNt6C8fT7FSY8JwD-ngZ3toF88bcOV9qA,8766
6
6
  mobile_mcp/core/dynamic_config.py,sha256=Ja1n1pfb0HspGByqk2_A472mYVniKmGtNEWyjUjmgK8,9811
7
7
  mobile_mcp/core/ios_client_wda.py,sha256=Nq9WxevhTWpVpolM-Ymp-b0nUQV3tXLFszmJHbDC4wA,18770
@@ -24,9 +24,9 @@ mobile_mcp/utils/__init__.py,sha256=8EH0i7UGtx1y_j_GEgdN-cZdWn2sRtZSEOLlNF9HRnY,
24
24
  mobile_mcp/utils/logger.py,sha256=Sqq2Nr0Y4p03erqcrbYKVPCGiFaNGHMcE_JwCkeOfU4,3626
25
25
  mobile_mcp/utils/xml_formatter.py,sha256=uwTRb3vLbqhT8O-udzWT7s7LsV-DyDUz2DkofD3hXOE,4556
26
26
  mobile_mcp/utils/xml_parser.py,sha256=QhL8CWbdmNDzmBLjtx6mEnjHgMFZzJeHpCL15qfXSpI,3926
27
- mobile_mcp_ai-2.5.5.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
28
- mobile_mcp_ai-2.5.5.dist-info/METADATA,sha256=hIceENDIHhcKXeiGHg9tS3iADHSky7HEPPTHR0QJ9EA,10495
29
- mobile_mcp_ai-2.5.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
30
- mobile_mcp_ai-2.5.5.dist-info/entry_points.txt,sha256=KB_FglozgPHBprSM1vFbIzGyheFuHFmGanscRdMJ_8A,68
31
- mobile_mcp_ai-2.5.5.dist-info/top_level.txt,sha256=lLm6YpbTv855Lbh8BIA0rPxhybIrvYUzMEk9OErHT94,11
32
- mobile_mcp_ai-2.5.5.dist-info/RECORD,,
27
+ mobile_mcp_ai-2.5.6.dist-info/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
28
+ mobile_mcp_ai-2.5.6.dist-info/METADATA,sha256=dd3JeAJ-53sZNKzN9-ga11MFJ8rf4YF9Cb8RX6fYq64,10213
29
+ mobile_mcp_ai-2.5.6.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
30
+ mobile_mcp_ai-2.5.6.dist-info/entry_points.txt,sha256=KB_FglozgPHBprSM1vFbIzGyheFuHFmGanscRdMJ_8A,68
31
+ mobile_mcp_ai-2.5.6.dist-info/top_level.txt,sha256=lLm6YpbTv855Lbh8BIA0rPxhybIrvYUzMEk9OErHT94,11
32
+ mobile_mcp_ai-2.5.6.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: bdist_wheel (0.45.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5