最新消息:20210917 已从crifan.com换到crifan.org

【未解决】XCode对于用WiFi无线连接的iPhone可以安装app但是wda的test最终失败:WebDriverAgentRunner-Runner Exiting due to IDE disconnection

iPhone crifan 608浏览 0评论
折腾:
【未解决】XCode对于WebDriverAgent项目编译和Test测试无线连接的iPhone
期间,XCode中无线WiFi连上了iPhone7P,但是最后test失败:
2020-07-01 14:02:28.965411+0800 WebDriverAgentRunner-Runner[10667:4797578] Running tests...
2020-07-01 14:03:23.550711+0800 WebDriverAgentRunner-Runner[10667:4797778] [Default] Exiting due to IDE disconnection.
好像无线连接不上了?断开了?
再去多试试几次
xxx@xxx  ~  ping 192.168.31.59
PING 192.168.31.59 (192.168.31.59): 56 data bytes
64 bytes from 192.168.31.59: icmp_seq=0 ttl=64 time=38.729 ms
64 bytes from 192.168.31.59: icmp_seq=1 ttl=64 time=5.932 ms
64 bytes from 192.168.31.59: icmp_seq=2 ttl=64 time=5.167 ms
Mac中还是能ping通此处的iPhone的
重新连上USB数据线,重新取消勾选 和 再次勾选 Connect via network
再去XCode编译test试试
看到iPhone中出现了app:
WebDriverAgentRunner-Runner 的图标:
继续:
结果又是失败:
感觉是:
只能无线连接去test,去安装app,但是无法无线连接执行test manager
How do you perform wireless debugging in Xcode 9 with iOS 11, Apple TV 4K, etc? – Stack Overflow
ios – “Connect via network” wireless debugging not working Xcode 9 – Stack Overflow
iphone – iOS – Run/Debug/Install builds over Wi-Fi – Stack Overflow
ios – Xcode “Device Locked” When iPhone is unlocked – Stack Overflow
ios – Xcode 9 Wireless debugging not working – Stack Overflow
Xcode无线调试_iOS_PING的专栏-CSDN博客_xcode passcode required
此处没有断开
所以右键中也没有
Connect via IP address
wireless networking – The device must have a passcode set in order to allow this operation (0xE8003FFE) – Super User
Xcode iphone wireless Exiting due to IDE disconnection
Xcode iphone  Wifi Exiting due to IDE disconnection
Xcode  Exiting due to IDE disconnection
iphone wda Exiting due to IDE disconnection
另外折腾其他的试试
右键
然后重新用USB数据线连到Mac中后,发现会(就像首次将此iPhone插入Mac中一样)弹框:
点击 信任
以及(由于前面设置了密码) 接着要输入密码了:
接着,Mac中iTunes中,识别了此iPhone,弹框问是否允许访问,点击继续:
再去多试试几次
此处:install app,还是没问题的。
但是最后问题依旧。
xcode test wireless iphone fail
ios – iPhone not connected – Stack Overflow
Turn off WIFI on Mac, and also on your iPhone too. Then turn on WIFI again on both devices.
去试试
Mac和iPhone都:关闭,再打开WiFi
不过感觉不用:
此处是能连上的,但是test失败
突然感觉:
此处或许是:WebDriverAgentRunner-Runner这个app或者说scheme本身,不支持无线测试连接被测iPhone?
去搜搜项目中代码,是否有:
Exiting due to IDE disconnection
iphone – Xcode Device Issue – Failed _shouldMakeReadyForDevelopment check even though device is not locked by passcode – Stack Overflow
某人是re-pairing the device可以
我此处前面已经这么做了,问题依旧。
Connect Iphone using Wireless not … | Apple Developer Forums
iPhone won’t connect to Xcode over… | Apple Developer Forums
再去搜:
Running tests 
找不到。
xcode Running tests Exiting due to IDE disconnection
去找找其他的方面
看到有个m文件
UITesingUITests.m
去找找,估计是入口文件,果然是:
然后,想到了,或许可以加上断点,去调试看看,能否运行,错在哪里?
结果:运行不到断点
说明上面代码没执行到
一直在Testing
最后Test Failed
然后也想过:去看看是否还有其他log日志,发现没有了:
这里是All Output,其他只有更少的2类的log:
然后去:
【未解决】用xcodebuild对于WiFi无线连接的iPhone去测试wda的WebDriverAgentRunner
Wireless Deployment for Xamarin.iOS and tvOS Apps – Xamarin | Microsoft Docs
都是这个:Connect via network
XCFrameworks Internals
关于xcodebuild – 简书
How to Test Your iOS Application on a Real Device – Twilio
Wireless Debugging — iOS- Run/Debug/Install builds over WiFi
重启mac和iPhone
XCode中依旧能看到设备
xxx@xxx  ~  ping 192.168.31.59
PING 192.168.31.59 (192.168.31.59): 56 data bytes
64 bytes from 192.168.31.59: icmp_seq=0 ttl=64 time=5.530 ms
64 bytes from 192.168.31.59: icmp_seq=1 ttl=64 time=4.457 ms
Mac依旧可以ping通iPhone
再去Xcode试试Test
期间看到了 installing app是OK的
不过截图时就闪过了
但是后续test 依旧报错
【后记20200702】
无意间发现:
Win中VMWare中macOS虚拟机中,用xcodebuild去测试USB数据线 有线连接的iPhone,测试也报错:
所以要去找找原因。
那就先去XCode中,用有线测试看看
回到公司Mac中试试
取消勾选Connect via network
确保是有线连接,没有🌍图标了:
再去test
可以成功test,且还能开始debug,有效的停在断点:
-》说明有线连接本身是test没问题的。
2020-07-02 09:23:49.543698+0800 WebDriverAgentRunner-Runner[405:40928] Running tests...
Test Suite 'All tests' started at 2020-07-02 09:23:52.104
Test Suite 'WebDriverAgentRunner.xctest' started at 2020-07-02 09:23:52.108
Test Suite 'UITestingUITests' started at 2020-07-02 09:23:52.110
上述log能看出是:
正常的话,应该输出:
Test Suite 'All tests' started at xxx
那再去勾上 Connect via network,然后无线test试试
然后此处,XCode的test时,虽然显示的连接的设备无🌍图标,表示有线连接,但是测试依旧失败:
很明显:测试期间,优先用无线去测试了。而没用有线去测试。
而取消无线勾选,果然的确又可以测试了:
验证了我的猜测是对的。
然后再回去macOS虚拟机中测试
就可以了,test可以继续了,且速度很快就可以继续test了:
2020-07-02 09:37:44.631336+0800 WebDriverAgentRunner-Runner[437:44979] Running tests...
Test Suite 'All tests' started at 2020-07-02 09:37:45.222
Test Suite 'WebDriverAgentRunner.xctest' started at 2020-07-02 09:37:45.223
Test Suite 'UITestingUITests' started at 2020-07-02 09:37:45.223
2020-07-02 09:37:45.236527+0800 WebDriverAgentRunner-Runner[437:44979] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2020-07-02 09:37:45.258039+0800 WebDriverAgentRunner-Runner[437:45128] [MC] Invalidating cache
2020-07-02 09:37:45.265460+0800 WebDriverAgentRunner-Runner[437:44979] [MC] Reading from public effective user settings.
2020-07-02 09:37:45.307725+0800 WebDriverAgentRunner-Runner[437:44979] [User Defaults] Couldn't write value for key KeyboardAutocorrection in CFPrefsPlistSource<0x28264d200> (Domain: com.apple.Preferences, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No): setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access
2020-07-02 09:37:45.326251+0800 WebDriverAgentRunner-Runner[437:45125] [MC] Invalidating cache
2020-07-02 09:37:45.329695+0800 WebDriverAgentRunner-Runner[437:44979] [MC] Reading from public effective user settings.
2020-07-02 09:37:45.331207+0800 WebDriverAgentRunner-Runner[437:44979] [User Defaults] Couldn't write value for key KeyboardPrediction in CFPrefsPlistSource<0x28264d200> (Domain: com.apple.Preferences, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No): setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access
2020-07-02 09:37:45.332420+0800 WebDriverAgentRunner-Runner[437:44979] [User Defaults] Couldn't write value for key KeyboardShowPredictionBar in CFPrefsPlistSource<0x28264d200> (Domain: com.apple.Preferences, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No): setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access
2020-07-02 09:37:45.355750+0800 WebDriverAgentRunner-Runner[437:44979] [User Defaults] Couldn't write value for key DidShowGestureKeyboardIntroduction in CFPrefsPlistSource<0x28264d200> (Domain: com.apple.Preferences, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No): setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access
Test Case '-[UITestingUITests testRunner]' started.
    t =     0.00s Start Test at 2020-07-02 09:37:45.359
    t =     0.00s Set Up
2020-07-02 09:37:45.391681+0800 WebDriverAgentRunner-Runner[437:44979] Built at Jun 29 2020 17:03:33
2020-07-02 09:37:45.422700+0800 WebDriverAgentRunner-Runner[437:44979] ServerURLHere->http://192.168.31.59:8100<-ServerURLHere
2020-07-02 09:37:45.430406+0800 WebDriverAgentRunner-Runner[437:45126] Using singleton test manager
说明正常有线连接和测试是没问题的。

转载请注明:在路上 » 【未解决】XCode对于用WiFi无线连接的iPhone可以安装app但是wda的test最终失败:WebDriverAgentRunner-Runner Exiting due to IDE disconnection

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
93 queries in 0.202 seconds, using 23.36MB memory