使用app agent时,无法启动activity

python版本

执行 python -V ,
Python 3.11.9

依赖环境

执行 pip list ,

Package Version


allure-pytest 2.15.0
allure-python-commons 2.15.0
annotated-types 0.7.0
anyio 4.10.0
Appium-Python-Client 5.2.2
attrs 25.3.0
beautifulsoup4 4.13.5
certifi 2025.8.3
charset-normalizer 3.4.3
click 8.2.1
csr_utils 2.0.0
cssselect 1.3.0
distro 1.9.0
fastapi 0.116.1
grandalf 0.8
greenlet 3.2.4
h11 0.16.0
hogwarts-agent-framework 1.9.1
hogwarts_agent_tools 1.9.0
hogwarts-appium-agent 1.9.0
hogwarts_appium_framework 1.9.1
hogwarts_auto_framework 1.9.2
hogwarts_ddt_framework 1.9.0
hogwarts-selenium-agent 1.9.0
hogwarts_selenium_framework 1.9.1
hogwarts-toolkit-framework 1.9.0
httpcore 1.0.9
httpx 0.28.1
idna 3.10
iniconfig 2.1.0
Jinja2 3.1.6
jiter 0.10.0
jmespath 1.0.1
jsonpatch 1.33
jsonpointer 3.0.0
langchain 0.3.27
langchain-core 0.3.75
langchain-ollama 0.3.7
langchain-openai 0.3.32
langchain-text-splitters 0.3.11
langgraph 0.6.6
langgraph-checkpoint 2.1.1
langgraph-prebuilt 0.6.4
langgraph-sdk 0.2.4
langsmith 0.4.21
lxml 5.4.0
MarkupSafe 3.0.2
ollama 0.5.3
openai 1.102.0
orjson 3.11.3
ormsgpack 1.10.0
outcome 1.3.0.post0
packaging 25.0
parsel 1.10.0
pillow 11.3.0
pip 24.0
pluggy 1.6.0
pydantic 2.11.7
pydantic_core 2.33.2
Pygments 2.19.2
pyparsing 3.2.3
PySocks 1.7.1
pytest 8.4.1
PyYAML 6.0.2
regex 2025.9.1
requests 2.32.5
requests-toolbelt 1.0.0
selenium 4.35.0
setuptools 65.5.0
sniffio 1.3.1
sortedcontainers 2.4.0
soupsieve 2.8
SQLAlchemy 2.0.43
starlette 0.47.3
tenacity 9.1.2
tiktoken 0.11.0
tqdm 4.67.1
trio 0.30.0
trio-websocket 0.12.2
typing_extensions 4.14.1
typing-inspection 0.4.1
urllib3 2.5.0
uvicorn 0.35.0
w3lib 2.3.1
websocket-client 1.8.0
wsproto 1.2.0
xxhash 3.5.0
zstandard 0.24.0

选择的智能体

appium agent

完整报错信息

请粘贴 完整的 Traceback,并用代码块 ``` 包裹,避免格式丢失
WARNING hogwarts::81 获取应用标签失败: Command ‘[‘aapt’, ‘dump’, ‘badging’, ‘/var/folders/jc/89k2pzm12cq620r85yqlglbc0000gp/T/tmpj5rmhqv5/com.android.shell.apk’]’ returned non-zero exit status 1.
WARNING hogwarts::81 获取应用标签失败: Command ‘[‘aapt’, ‘dump’, ‘badging’, ‘/var/folders/jc/89k2pzm12cq620r85yqlglbc0000gp/T/tmpj5rmhqv5/com.UCMobile.apk’]’ died with <Signals.SIGABRT: 6>.
WARNING hogwarts::81 获取应用标签失败: Command ‘[‘aapt’, ‘dump’, ‘badging’, ‘/var/folders/jc/89k2pzm12cq620r85yqlglbc0000gp/T/tmpj5rmhqv5/com.android.traceur.apk’]’ returned non-zero exit status 1.
WARNING hogwarts::81 获取应用标签失败: Command ‘[‘aapt’, ‘dump’, ‘badging’, ‘/var/folders/jc/89k2pzm12cq620r85yqlglbc0000gp/T/tmpj5rmhqv5/com.tencent.mobileqq.apk’]’ died with <Signals.SIGABRT: 6>.
WARNING hogwarts::81 获取应用标签失败: Command ‘[‘aapt’, ‘dump’, ‘badging’, ‘/var/folders/jc/89k2pzm12cq620r85yqlglbc0000gp/T/tmpj5rmhqv5/com.google.android.gms.apk’]’ died with <Signals.SIGABRT: 6>.
WARNING hogwarts::81 获取应用标签失败: Command ‘[‘aapt’, ‘dump’, ‘badging’, ‘/var/folders/jc/89k2pzm12cq620r85yqlglbc0000gp/T/tmpj5rmhqv5/com.jingdong.app.mall.apk’]’ died with <Signals.SIGABRT: 6>.
WARNING hogwarts::81 获取应用标签失败: Command ‘[‘aapt’, ‘dump’, ‘badging’, ‘/var/folders/jc/89k2pzm12cq620r85yqlglbc0000gp/T/tmpj5rmhqv5/com.eg.android.AlipayGphone.apk’]’ died with <Signals.SIGABRT: 6>.
WARNING hogwarts::81 获取应用标签失败: Command ‘[‘aapt’, ‘dump’, ‘badging’, ‘/var/folders/jc/89k2pzm12cq620r85yqlglbc0000gp/T/tmpj5rmhqv5/com.tencent.mm.apk’]’ died with <Signals.SIGABRT: 6>.
WARNING hogwarts::81 获取应用标签失败: Command ‘[‘aapt’, ‘dump’, ‘badging’, ‘/var/folders/jc/89k2pzm12cq620r85yqlglbc0000gp/T/tmpj5rmhqv5/com.vivo.seservice.apk’]’ died with <Signals.SIGABRT: 6>.
WARNING hogwarts::81 获取应用标签失败: Command ‘[‘aapt’, ‘dump’, ‘badging’, ‘/var/folders/jc/89k2pzm12cq620r85yqlglbc0000gp/T/tmpj5rmhqv5/com.autonavi.minimap.apk’]’ died with <Signals.SIGABRT: 6>.
ERROR hogwarts::375 任务执行失败 (ValueError): 未找到应用 ‘io.appium.android.apis/.ApiDemos’ 的完整 activity,请确认app名称是否正确。
Traceback (most recent call last):
File “”, line 349, in run
File “”, line 203, in _execute
File “/Users/ceshiguanlichu/venv/lib/python3.11/site-packages/langgraph/pregel/main.py”, line 3026, in invoke
for chunk in self.stream(
File “/Users/ceshiguanlichu/venv/lib/python3.11/site-packages/langgraph/pregel/main.py”, line 2647, in stream
for _ in runner.tick(
File “/Users/ceshiguanlichu/venv/lib/python3.11/site-packages/langgraph/pregel/_runner.py”, line 162, in tick
run_with_retry(
File “/Users/ceshiguanlichu/venv/lib/python3.11/site-packages/langgraph/pregel/_retry.py”, line 42, in run_with_retry
return task.proc.invoke(task.input, config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/ceshiguanlichu/venv/lib/python3.11/site-packages/langgraph/_internal/_runnable.py”, line 657, in invoke
input = context.run(step.invoke, input, config, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/ceshiguanlichu/venv/lib/python3.11/site-packages/langgraph/_internal/_runnable.py”, line 401, in invoke
ret = self.func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “”, line 47, in call
File “/Users/ceshiguanlichu/venv/lib/python3.11/site-packages/langchain_core/tools/base.py”, line 604, in invoke
return self.run(tool_input, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/ceshiguanlichu/venv/lib/python3.11/site-packages/langchain_core/tools/base.py”, line 888, in run
raise error_to_raise
File “/Users/ceshiguanlichu/venv/lib/python3.11/site-packages/langchain_core/tools/base.py”, line 857, in run
response = context.run(self._run, *tool_args, **tool_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/ceshiguanlichu/venv/lib/python3.11/site-packages/langchain_core/tools/structured.py”, line 93, in _run
return self.func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “”, line 117, in wrapper
File “”, line 54, in start
File “”, line 95, in start
File “”, line 193, in _init_driver
ValueError: 未找到应用 ‘io.appium.android.apis/.ApiDemos’ 的完整 activity,请确认app名称是否正确。
During task with name ‘tool_execution’ and id ‘94b3fe5f-df4d-8dba-3723-6297891729fe’
==================================================================== warnings summary =====================================================================
_testcase_dir_3/test_appium.py::Testappium::test_template
:130: LangGraphDeprecatedSinceV10: config_schema is deprecated and will be removed. Please use context_schema instead. Deprecated in LangGraph V1.0 to be removed in V2.0.

_testcase_dir_3/test_appium.py: 10 warnings
:81: DeprecationWarning: The ‘warn’ method is deprecated, use ‘warning’ instead

– Docs: How to capture warnings - pytest documentation
================================================================= short test summary info =================================================================
FAILED _testcase_dir_3/test_appium.py::Testappium::test_template - ValueError: 未找到应用 ‘io.appium.android.apis/.ApiDemos’ 的完整 activity,请确认app名称是否正确。
======================================================= 1 failed, 11 warnings in 387.93s (0:06:27) ========================================================
[2025-09-03 17:14:46][INFO][:93 start_pytest] 删除临时目录:/Users/ceshiguanlichu/_testcase_dir_3
[2025-09-03 17:14:46][INFO][:93 _frame_producer] :x: Frame producer error:cannot schedule new futures after shutdown

使用场景

执行测试用例

期望结果

正确启动app 并执行

需要写app的名称即可,例如

"1、打开安卓应用 'API Demos'."
 "2、点击'Animation'."

老师,appium启动出现了问题,正常都是可以用的

Appium启动失败了,你单独用Appium能打开app,做操作吗?

可以, appium -p 4273

[Appium] Welcome to Appium v2.4.1

[Appium] Non-default server args:

[Appium] {

[Appium] port: 4273

[Appium] }

[Appium] The autodetected Appium home path: /Users/ceshiguanlichu

[Appium] Attempting to load driver xcuitest…

[Appium] Attempting to load driver uiautomator2…

[Appium] Attempting to load driver chromium…

[Appium] Requiring driver at /Users/ceshiguanlichu/node_modules/appium-xcuitest-driver/build/index.js

[Appium] Requiring driver at /Users/ceshiguanlichu/node_modules/appium-uiautomator2-driver/build/index.js

[Appium] Requiring driver at /Users/ceshiguanlichu/node_modules/appium-chromium-driver/index.js

[Appium] XCUITestDriver has been successfully loaded in 10.268s

[Appium] AndroidUiautomator2Driver has been successfully loaded in 10.268s

[Appium] ChromiumDriver has been successfully loaded in 10.268s

[Appium] Appium REST http interface listener started on http://0.0.0.0:4273

[Appium] You can provide the following URLs in your client code to connect to this server:

[Appium] http://127.0.0.1:4273/ (only accessible from the same host)

[Appium] http://10.136.190.144:4273/

[Appium] Available drivers:

[Appium] - xcuitest@7.1.2 (automationName ‘XCUITest’)

[Appium] - uiautomator2@3.0.1 (automationName ‘UiAutomator2’)

[Appium] - chromium@1.3.14 (automationName ‘Chromium’)

[Appium] No plugins have been installed. Use the “appium plugin” command to install the one(s) you want to use.

是不是启动命令这里不行呢?我个人只使用了appium -p 4723 是没有问题的

我意思是你用传统的自动化,Appium可以正常操作app 点击吗