You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

启动应用触发WebDriverException,命令行报POST //session 404错误求助

解决Appium启动应用时POST //session 404错误的方案

可能的原因及对应解决方法

  • Appium服务未正确启动或端口不匹配

    • 确认Appium服务正在运行,代码中配置的remote_url端口与服务监听端口一致(默认4723)。
    • 检查启动日志,确认服务成功启动,日志需显示Appium REST http interface listener started on 0.0.0.0:4723类提示。
  • Remote URL格式错误

    • 代码中webdriver.Remote的URL必须是完整路径,需包含/wd/hub后缀,比如正确格式为http://localhost:4723/wd/hub,遗漏后缀会直接触发404。
  • 版本不兼容

    • 检查Appium服务版本与客户端SDK(如appium-python-client)版本是否匹配,Appium 2.x需搭配最新版客户端,旧版客户端可能不支持新版接口路径。
    • 可执行pip install --upgrade appium-python-client升级Python客户端,或调整Appium版本至匹配状态。
  • 设备连接异常

    • 执行adb devices确认设备状态为device,若显示offline或未列出,执行adb kill-server && adb start-server重启ADB服务后重新连接设备。
  • 应用配置校验

    • 即使已配置Activity,仍需通过adb shell dumpsys window | grep mCurrentFocus命令获取当前应用的包名与完整Activity路径,对比配置是否完全一致,Activity需写全路径(如com.example.app.MainActivity)。
  • 权限问题(Linux/macOS环境)

    • 确认当前用户有权限访问设备,可临时用sudo appium启动服务测试,或检查Android设备的udev规则配置是否正确。

用户错误信息引用

WebDriverException: Message: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource

内容的提问来源于stack exchange,提问作者user22694928

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.09 14:08:16