首页 > 解决方案 > Appium - iOS - 写入 xctestrun 文件时出错:错误域 = NSCocoaErrorDomain 代码 = 4

问题描述

我正在尝试将 Appium 1.12.1 连接到具有自动服务器的物理 iOS 设备。这些是我正在尝试的功能:

{
  "browserName": "Safari",
  "platformName": "iOS",
  "platformVersion": "12.1",
  "deviceName": "iPhone 6",
  "automationName": "XCUITest",
  "startIWDP": true,
  "udid": "auto"
}

我收到一个冗长的错误,开头是:

An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent because of xcodebuild failure: "xcodebuild failed with code 65 xcodebuild error message: 2019-04-09 10:14:08.626 xcodebuild[22198:212737] Error writing xctestrun file: Error Domain=NSCocoaErrorDomain Code=4 "The folder “WebDriverAgentRunner_iphoneos12.2-arm64.xctestrun” doesn’t exist." 

标签: iosxcodeappium

解决方案


我有同样的问题。在“/Users/YOUR_NAME/Library/Developer/Xcode/DerivedData/”我有两个文件夹: WebDriverAgent-akxhdiizyykdxefsthlnfyomlaiz WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu

Appium 尝试从 WebDriverAgent-akxhdiizyykdxefsthlnfyomlaiz 获取文件夹,但需要 WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu。我从 WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu 复制到 WebDriverAgent-akxhdiizyykdxefsthlnfyomlaiz,现在一切正常。


推荐阅读