macaca
macaca copied to clipboard
多台真机IOS自动化时候,代理端口的逻辑有问题
两台IOS真机设备同时并行执行,第二台设备也会请求8900端口设置iproxy。看代码是先判断端口是否占用,占用了之后取一个新的,实际没有实现这个效果。
this.proxyPort = yield detect(this.proxyPort);
第一台设备正常启动初始化日志正常:
>> xctest-client start with port: 8900
>> xctest-client.js:233:14 [master] pid:8658 xcode version: 8.2.1
>> WebDriverAgent version: 1.0.41
第二个设备初始化日志,重试的几次都是下面的报错
>> xctest-client start with port: 8900
>> xctest-client.js:233:14 [master] pid:8658 xcode version: 8.2.1
>> WebDriverAgent version: 1.0.41
>> xctest-client.js:209:14 [master] pid:8658 iproxy exit with code: 208, signal: null
detect-port.js 里面判断端口的方式无效,一直是8900 怎么解决这个问题?
改了代码支持ios初始化driver传参代理端口,多个设备分别指定iproxyport,可并行
https://github.com/baozhida/macaca-ios/blob/master/lib/macaca-ios.js
@baozhida 能发个pull request过来看看嘛?
@xudafeng 已经发了