【问题标题】:Appium Not Running Xcode 12.3Appium 未运行 Xcode 12.3
【发布时间】:2021-04-13 07:41:24
【问题描述】:

我正在尝试使用 Appium 1.19.1 版在我使用 Xcode 12.3 构建的物理 ipad 设备上测试 ipad 应用程序。以前这按预期工作,但最近我根本无法让 Appium 运行,我怀疑 Xcode 12.3 可能是我发现的问题。

当我尝试从 python 运行 Appium 时,这是打印到我的 python 控制台的跟踪(设备序列号/udid 故意隐藏):

    File "/Users/opt/anaconda3/lib/python3.7/site-packages/appium/webdriver/webdriver.py", line 155, in __init__
    proxy
  File "/Users/opt/anaconda3/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "/Users/opt/anaconda3/lib/python3.7/site-packages/appium/webdriver/webdriver.py", line 225, in start_session
    response = self.execute(RemoteCommand.NEW_SESSION, parameters)
  File "/Users/opt/anaconda3/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/Users/opt/anaconda3/lib/python3.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: 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:

2021-01-06 17:04:24.366 xcodebuild[16217:213101] Error writing xctestrun file: Error Domain=NSCocoaErrorDomain Code=4 "The folder “WebDriverAgentRunner_iphoneos14.3-arm64.xctestrun” doesn’t exist." UserInfo={NSFilePath=/Users/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Build/Products/WebDriverAgentRunner_iphoneos14.3-arm64.xctestrun, NSUserStringVariant=Folder, NSUnderlyingError=0x7fb116ac6ad0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
** TEST BUILD FAILED **
2021-01-06 17:04:24.380 xcodebuild[16217:213102]  IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/Users/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2021.01.06_17-04-22--0600.xcresult/Staging/2_Test/Diagnostics/WebDriverAgentRunner-E1E91CAE-6813-4009-872F-D9B73C898BBD/WebDriverAgentRunner-0D722399-E7A6-4474-8791-593FA62358F6/Session-WebDriverAgentRunner-2021-01-06_170424-nMI8G0.log
2021-01-06 17:04:24.382 xcodebuild[16217:213028] [MT] IDETestOperationsObserverDebug: (DF79B2A2-04AF-4A59-87B7-DBB8279EC46E) Beginning test session WebDriverAgentRunner-DF79B2A2-04AF-4A59-87B7-DBB8279EC46E at 2021-01-06 17:04:24.381 with Xcode 12C33 on target ????<DVTiOSDevice (0x7fb11a157e10), ****, iPad, 14.3 (18C66), ****> {
        deviceSerialNumber:         ****
        identifier:                 ****
        deviceClass:                iPad
        deviceName:                 ****
        deviceIdentifier:           ****
        productVersion:             14.3
        buildVersion:               18C66
        deviceSoftwareVersion:      14.3 (18C66)
        deviceArchitecture:         arm64e
        deviceTotalCapacity:        249024532480
        deviceAvailableCapacity:    240144109568
        deviceIsTransient:          NO
        ignored:                    NO
        deviceIsBusy:               NO
        deviceIsPaired:             YES
        deviceIsActivated:          YES
        deviceActivationState:      Activated
        isPasscodeLocked:           NO
        deviceType:                 <DVTDeviceType:0x7fb113d0a3d0 Xcode.DeviceType.iPhone>
        supportedDeviceFamilies:    (
    1,
    2
)
        applications:              (null)
        provisioningProfiles:      (null)
        hasInternalSupport:        NO
        hasWritableSystem:         NO
        isSupportedOS:             YES
        bootArgs:                  (null)
        nextBootArgs:              (null)
        connected:                 YES
        isWirelessEnabled:         NO
        connectionType:            direct
        hostname:                  (null)
        bonjourServiceName:        ****
        activeProxiedDevice:       (null)
        } (14.3 (18C66))
2021-01-06 17:04:24.498 xcodebuild[16217:213028] [MT] IDETestOperationsObserverDebug: (****) Finished requesting crash reports. Continuing with testing.
*** If you believe this error represents a bug, please attach the result bundle at /Users/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2021.01.06_17-04-22--0600.xcresult
2021-01-06 17:04:24.514 xcodebuild[16217:213028] [MT] IDETestOperationsObserverDebug: 0.141 elapsed -- Testing started completed.
2021-01-06 17:04:24.514 xcodebuild[16217:213028] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec -- start
2021-01-06 17:04:24.514 xcodebuild[16217:213028] [MT] IDETestOperationsObserverDebug: 0.141 sec, +0.141 sec -- end
Test session results, code coverage, and logs:
    /Users/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2021.01.06_17-04-22--0600.xcresult
Testing failed:
    Building for iOS, but the embedded framework 'CocoaAsyncSocket.framework' was built for iOS + iOS Simulator.
    Building for iOS, but the embedded framework 'YYCache.framework' was built for iOS + iOS Simulator.
    Building for iOS, but the linked and embedded framework 'CocoaAsyncSocket.framework' was built for iOS + iOS Simulator.
    Building for iOS, but the linked and embedded framework 'YYCache.framework' was built for iOS + iOS Simulator.
    WebDriverAgentRunner:
        WebDriverAgentRunner-Runner.app encountered an error (Failed to install or launch the test runner. If you believe this error represents a bug, please attach the result bundle at /Users/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2021.01.06_17-04-22--0600.xcresult. (Underlying Error: The file “WebDriverAgentRunner-Runner.app” couldn’t be opened because there is no such file. The file doesn’t exist. (Underlying Error: The operation couldn’t be completed. No such file or directory)))
** TEST EXECUTE FAILED **
Testing started. 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.

通过研究,我发现this answer 链接到an apple developer forum post,这让我相信问题出在appium 必须使用的框架之一与Xcode 12.3 不合作。

我也遇到过another suggestion,我尝试过,但没有解决我的问题。

另外,这就是我在Test-WebDriverAgentRunner-2021.01.06_17-04-19--0600.xcresult 看到的:

  Assertions: System: Failed to install or launch the test runner. If you believe this error represents a bug, please attach the result bundle at /Users/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2021.01.06_17-04-19--0600.xcresult. (Underlying Error: The file “WebDriverAgentRunner-Runner.app” couldn’t be opened because there is no such file. The file doesn’t exist. (Underlying Error: The operation couldn’t be completed. No such file or directory))

那么此时我还有什么可以尝试的,或者这是否会归结为 appium 使用的框架需要更新?任何想法或建议都非常感谢!

【问题讨论】:

    标签: ios xcode appium


    【解决方案1】:

    原来我必须在 WebDriverAgent Xcode 项目上关注the suggestion in this answer 但是。好像已经帮我修好了。

    【讨论】:

      【解决方案2】:

      在真实设备上安装 WDA 后,在 appium 1.20 上为我工作了这样的解决方法:

      $ cd ~/Library/Developer/Xcode/DerivedData 
      $ rm -rf WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp 
      $ mv WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp
      

      【讨论】:

        猜你喜欢
        • 2021-03-26
        • 2013-10-31
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-05-16
        相关资源
        最近更新 更多