appium默认60秒关闭应用的问题

问题:appium默认启动一个应用的session过期时间是60秒到时间会自动停了刚启动的应用,工作台打印:info: [debug] We shut down because no new commands came in的日志

分析:--command-timeout 60 The default command timeout for the server to use for all sessions (in seconds and should be less than 2147483). Will still be overridden by newCommandTimeout cap

意思是默认60秒过期,超过60秒就会自动

解决办法:

从appium工作台最前面找到,启动命令:

> Launching Appium server with command: C:\Program Files (x86)\Appium\node.exe lib\server\main.js --address 127.0.0.1 --port 4723 --avd Nexus7 --platform-name Android --platform-version 19 --automation-name Appium --device-name "Android Emulator" --log-no-color

在cmd命令行,对应目录加时间参数即可:--command-timeout 600

在目录:C:\Program Files (x86)\Appium>

执行

node.exe node_modules\appium\lib\server\main.js --

address 127.0.0.1 --port 4723 --avd Android4.4.2 --device-ready-timeout 70 --pla

tform-name Android --platform-version 19 --automation-name Appium --avd Nexus7 -

-device-name "Android Emulator" --log-no-color --command-timeout 600

启动日志中就能看到:

info: [debug] Non-default server args: {"address":"127.0.0.1","logNoColors":true

,"avd":"Nexus7","androidDeviceReadyTimeout":"70","deviceName":"Android Emulator"

,"platformName":"Android","platformVersion":"19","automationName":"Appium","defa

ultCommandTimeout":600}

时间变成600秒了

【整整200集】超超超详细的Python接口自动化测试进阶教程合集,真实模拟企业项目实战

相关推荐
阿林来了19 小时前
Flutter三方库适配OpenHarmony【flutter_speech】— 单元测试与集成测试
flutter·单元测试·集成测试·harmonyos
米羊12119 小时前
Log4j
单元测试
七夜zippoe1 天前
单元测试进阶:pytest高级特性与实战秘籍
单元测试·pytest·持续集成·猴子补丁·fixtrue
金銀銅鐵1 天前
浅解 Junit 4 第七篇:AllDefaultPossibilitiesBuilder
java·junit·单元测试
@zulnger2 天前
单元测试框架 —— unittest
python·单元测试
金銀銅鐵2 天前
浅解 Junit 4 第六篇:AnnotatedBuilder 和 RunnerBuilder
后端·junit·单元测试
派大星-?2 天前
为什么要接口测试
单元测试
金銀銅鐵3 天前
浅解 Junit 4 第五篇:IgnoredBuilder 和 RunnerBuilder
junit·单元测试
桂花很香,旭很美3 天前
[7天实战入门Go语言后端] Day 6:测试与 Docker 部署——单元测试与多阶段构建
docker·golang·单元测试
Bug 挖掘机4 天前
2025年年终总结
软件测试·测试开发