赞
踩
1、WebdriverAgent 在 Xcode + 真机上 test 正常
2、开启 appium server 后,UI 脚本启动后提示:
[W3C][39m Encountered internal error running command:
Error: Unable to launch WebDriverAgent because of xcodebuild failure:
xcodebuild failed with code 70
xcodebuild failed with code 70
解决思路都是:
(1)在 Xcode 上启动WebdriverAgent,再执行
(2)升级 appium
但我本地已经是最新appium 并在真机上testing了。
应该不是一样的问题,可能有其他问题,继续查看日志。
日志里有一行:
2021-06-25 07:58:19:379 [WebDriverAgent] Output from xcodebuild will only be logged if any errors are present there.
To change this, use 'showXcodeLog' desired capability
caps['showXcodeLog']=True
继续执行 UI 脚本,出现新的报错信息了!
[W3C] Command line invocation: ... [W3C] xcodebuild: error: Unable to find a destination matching the provided destination specifier: [W3C] { id:00008222-001E11D90C32223A } [W3C] The requested device could not be found because no available devices matched the request. [W3C] Available destinations for the "WebDriverAgentRunner" scheme: [W3C] { platform:macOS, arch:x86_64, variant:Mac Catalyst, id:46A4FF54-646C-5CD8-B468-A5240CB2A493 } [W3C] { platform:iOS, id:00008222-001A48322E32222E, name:11pro } [W3C] { platform:iOS Simulator, id:C0C7BD5B-7E0C-4647-BF54-795787136C76, OS:14.4, name:iPhone 11 } [W3C] { platform:iOS Simulator, id:D6E39731-468F-468E-875B-930A3C341A71, OS:14.4, name:iPhone 11 Pro } [W3C] { platform:iOS Simulator, id:C2D66A8F-2B7C-4E48-80CC-14C2086E3149, OS:14.4, name:iPod touch (7th generation) } [W3C] Ineligible destinations for the "WebDriverAgentRunner" scheme: [W3C] { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device } [W3C] { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device } [W3C] { platform:macOS, variant:Mac Catalyst, name:Any Mac }. Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device. [W3C] at quitAndUninstall (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:528:15) [W3C] at /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:558:11 [W3C] at wrapped (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:35:13) [W3C] at retry (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:18:13) [W3C] at retryInterval (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/asyncbox/lib/asyncbox.js:45:10) [W3C] at /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/driver.js:538:7 [W3C] Destroying socket connection [HTTP] <-- POST /wd/hub/session 500 73297 ms - 8303 [HTTP]
重点在这两行:
[W3C] xcodebuild: error: Unable to find a destination matching the provided destination specifier:
[W3C] { id:00008222-001E11D90C32223A }
[W3C] The requested device could not be found because no available devices matched the request.
[W3C] Available destinations for the "WebDriverAgentRunner" scheme:
[W3C] { platform:macOS, arch:x86_64, variant:Mac Catalyst, id:46A4FF54-646C-5CD8-B468-A5240CB2A493 }
[W3C] { platform:iOS, id:00008222-001A48322E32222E, name:11pro }
xcodebuild 执行时,找不到 id:00008222-001E11D90C32223A
但我执行的设备是 11pro 啊, id:00008222-001A48322E32222E
○| ̄|_
好叭,继续看:
> instruments -s devices
`instruments` is now deprecated in favor of 'xcrun xctrace' (see `man xctrace` for more information on its replacement)
Known Devices:
(null) [00008222-001E11D90C32223A]
11pro (14.3) [00008222-001A48322E32222E]
00008222-001E11D90C32223A 是个 null ???
换个设备连上电脑:
> instruments -s devices
`instruments` is now deprecated in favor of 'xcrun xctrace' (see `man xctrace` for more information on its replacement)
Known Devices:
XsMax (14.6) [00008222-001E11D90C32223A]
(null) [00008222-001A48322E32222E]
嗷,懂了。
两台设备都连上电脑了,想跑 A 时会自动连接 B,想跑 B 时会自动连接 A
○| ̄|_
那现在是 2 两台设备: XsMax 和 11pro
想跑 11pro,那把 XsMax 先关机试一下:
> instruments -s devices
`instruments` is now deprecated in favor of 'xcrun xctrace' (see `man xctrace` for more information on its replacement)
Known Devices:
11pro (14.3) [00008222-001A48322E32222E]
妥了,重新执行 UI脚本,正常执行! yeah
( 嗷,另一台设备也可以重新启动了,之后就ok了
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。