WebDriverAgent crashes when Appium tries to get device Screenshot

Hi,

I’m working in automation and I’m facing a problem regarding iPhone. I’m using Appium and WebDriverAgent to automate in real devices, you can check below more details concerning the devices and work environment. Our app is divided in two sections, an onboarding (with environment selection, login section and profile selection) and the main app menu. My problem starts in the main menu. The app is so complex that the WebDriverAgent crashes every time I try to use Appium to inspect elements from the main menu (everything works properly in the onboarding section). I’ve tried also with “snapshotTimeout” and “useJSONSource” in the capabilities, but with the same result.

As the WebDriverAgent crashes, I got the following error message from Appium when it tried to grab the elements from the main menu (I also have a complete Appium log at the bottom of this page):

An unknown server-side error occurred while processing the command.
Original error: Unable to start WebDriverAgent session because of xcodebuild failure: An unknown server-side error occurred while processing the command.
Original error: Could not proxy command to the remote server.
Original error: socket hang up 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 devices.

Using Appium-doctor, I can see that have all main dependencies installed and ready to use. And as I said, everything works properly in the onboarding section.

Work Environment

Mac: macOS Catalina Version 10.15.6
Appium Version 1.18.0
Node.js Version 14.7.0
Xcode Version 11.6 (11E708)
Real Devices:
• iPhone 5s with iOS 12.4.3
• iPad Pro 12.9 with iPadOS 13.1

Devices Capabilities in Appium

Appium iPhone Capabilities:

{
“deviceName”: “Vodafone”,
“udid”: “409f4d079cf6425e3a1888557473251266dc9679”,
“platformName”: “iOS”,
“automationName”: “XCUITest”,
“platformVersion”: “12.4.3”,
“xcodeOrgId”: “[teamID]”,
“xcodeSigninId”: “iPhone Developer”,
“useNewWDA”: false
}

Appium iPad Capabilities:

{
“deviceName”: “Vodafone”,
“udid”: " ac4e55b63854d4c3bcf140789d7e352935fd98f9 ",
“platformName”: “iOS”,
“automationName”: “XCUITest”,
“platformVersion”: “13.1”,
“xcodeOrgId”: “[teamID]”,
“xcodeSigninId”: “iPhone Developer”,
“useNewWDA”: false
}

Xcode WebDriverAgent Logs:
WebDriverAgentRunner_LOGS.txt (16.4 KB)

Appium Complete Logs:
Appium Complete LOG.txt (69.8 KB)

Any feedback on this would be great.
Thank you in advance.

I would also try to limit the value of snapshotMaxDepth setting and/or disable visibility detection as described in https://github.com/appium/appium/issues/13595#issuecomment-554256741

Although, these would be just workarounds. Only Apple is able to fix the original cause

Thanks for your response. I did play with the capabilities with different configurations, but still got the same result. Actually, in iPad, I can execute my tests and inspect the elements, using the same application (same ipa). The problem only occurs in iPhone. In Android everything seems to be working as expected.
Thank you.