有可能是因为启动Appium时版本不匹配导致的问题。你可以尝试将Appium版本降低或者使用匹配的版本。如果这个问题依然存在,则可以尝试升级或者降级WebDriverAgent(如果你是在iOS设备上运行测试)。如果仍然无法解决问题,则可以尝试更新依赖库并重新编译源代码。以下是一个示例,展示如何对WebDriverAgent进行升级:
cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
./Scripts/bootstrap.sh -d
./Scripts/build.sh