通过代码为部署目标-Apple TV(v13.3) 构建并启动 'WebDriverAgentRunner_tvOS'

Build and launch 'WebDriverAgentRunner_tvOS' for deployment target-Apple TV(v13.3) through code

我是 appium 和 tvOS 的新手。我正在使用 appium 1.16.0 桌面版。当我使用所需的设置、正确的方案和目标以及正确的代码签名身份构建 WebDriverAgentRunner_tvOS(来自 XCODE)时,它构建得很好。稍后启动 appium 并使用所需的上限(如下所述)启动 appium inspector 会在目标设备上成功安装 WDA 并启动应用程序。如果我尝试从 java 代码尝试从 main.js(Applications/Appium.app/Contents/Resources/app/node_modules/appium/build/lib/main.js) 启动 appium,我会收到以下错误。

Error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 70

APPIUM CAPS(对于模拟器。同样适用于真实设备): { "app": "com.xxxx.xxxx-xx", "platformName": "tvOS", "platformVersion": "13.3", "deviceName": "Apple TV", "realDevice":错误, "udid": "FEF50073-E986-4332-8E0B-6434D9AD8A11", "xcodeOrgId": "XXXXXXXXXX", "xcodeSigningId": "Apple Developer", "useNewWDA":真 }

环境: macOS 卡特琳娜 (10.15.1) XCODE v11.3 Appium v​​1.16.0 tvOS v13.3

注意:从日志看来,WDAgentRunner 在从 main.js(通过代码)启动 appium 时试图为不同的目标构建; 在为具有相同所需上限 的相同 appium.app 启动 appium 检查器时工作正常。下面的日志。

    [Xcode] 
[Xcode]     IDEDerivedDataPathOverride = /Users/debajyoti.bose/Library/Developer/Xcode/DerivedData/WebDriverAgent-bftxdyupbfulprcrdichuqzzkdsz
[Xcode] 
[Xcode] Build settings from command line:
[Xcode]     COMPILER_INDEX_STORE_ENABLE = NO
[Xcode]     GCC_TREAT_WARNINGS_AS_ERRORS = 0
[Xcode]     IPHONEOS_DEPLOYMENT_TARGET = 13.3
[Xcode] 
[Xcode] 
[WD Proxy] Got an unexpected response with status undefined: {"errno":-61,"code":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":8100}
[Xcode] xcodebuild: error: Unable to find a destination matching the provided destination specifier:
[Xcode]         { id:FEF50073-E986-4332-8E0B-6434D9AD8A11 }
[Xcode] 
[Xcode]     Available destinations for the "WebDriverAgentRunner" scheme:
[Xcode]         { platform:macOS, arch:x86_64, variant:Mac Catalyst, id:1711F5AF-1EA1-58EC-9543-6E9E6BA75B19 }
[Xcode]         { platform:iOS Simulator, id:D185E9C1-0F68-4771-8971-CAB2CE2D73A1, OS:13.3, name:iPad (7th generation) }
[Xcode]         { platform:iOS Simulator, id:FD2C3C04-ABA2-4514-A45A-39E52B0A0BAA, OS:13.3, name:iPad Air (3rd generation) }
[Xcode]         { platform:iOS Simulator, id:B142E5F1-2354-49C2-8CFD-1066DC254C1A, OS:13.3, name:iPad Pro (9.7-inch) }
[Xcode]         { platform:iOS Simulator, id:3730F0AE-0526-4500-B8C3-4317B93D5822, OS:13.3, name:iPad Pro (11-inch) }
[Xcode]         { platform:iOS Simulator, id:65014AAE-309E-4A06-895A-DB4BA4DE3D74, OS:13.3, name:iPad Pro (12.9-inch) (3rd generation) }
[Xcode]         { platform:iOS Simulator, id:870EBC55-8E7D-4D6A-8239-8DC9E64F5558, OS:13.3, name:iPhone 8 }
[Xcode]         { platform:iOS Simulator, id:0D1CA5E4-7710-4ED7-8490-D0A0D23ADB3F, OS:13.3, name:iPhone 8 Plus }
[Xcode]         { platform:iOS Simulator, id:A5DF86A7-3425-4EB6-86C3-37F124954374, OS:13.3, name:iPhone 11 }
[Xcode]         { platform:iOS Simulator, id:FF3AB897-7B93-4901-8362-C4FA727A2631, OS:13.3, name:iPhone 11 Pro }
[Xcode]         { platform:iOS Simulator, id:61F93B37-2BC9-4C87-8DE1-1CB096460B50, OS:13.3, name:iPhone 11 Pro Max }
[Xcode] 
[Xcode]     Ineligible destinations for the "WebDriverAgentRunner" scheme:
[Xcode]         { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Generic iOS Device }
[Xcode]         { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Generic iOS Simulator Device }
[Xcode] 
[XCUITest] xcodebuild exited with code '70' and signal 'null'

想通了。正在初始化 IOSDriver。必须使用 AppiumDriver instead.IOSDriver 默认为 iPhone 平台,尽管 'platformName' 功能被定义为 tvOS。感到困惑,因为 appium 中没有可用的特定 tvOS 驱动程序。尽管如果单独安装 WDARunner,使用 iOS 驱动程序也可以正常工作。 Appium inspector(Desktop UI) 知道它,因为驱动程序没有在那里明确初始化